yep, if you're using VB then make sure you set the SCALEWIDTH properties
correctly as below or you'll get wierd results.

with this resizing thing, my apps use it, however i've set MI to only resize
it's display after the size of the container window has changed by more than
10%.  this reduces the API overhead associated with making a call every time
the user resizes it, or in other words, instead of there being say 50 resize
calls made as the user expands the map window, it only does a couple.  i
also provide a manual refresh/resize button for when the resize they have
done does not exceeed 10%.

the reason for all this, is essentially because i was encountering errors
with stuff to do with simultaneous commands.  if anyone has robust code for
on the fly resizing, then i'd appreciate being able to check it out.  it's
just that i found it to be too unstable so i chose the 10 percent solution.

ash.

-----Original Message-----
From: CRISP, Paul -Syntegra UK [mailto:[EMAIL PROTECTED]
Sent: Saturday, 1 March 2003 1:47 AM
To: 'Windeler, David'; 'MapInfo-L (E-mail)
Subject: RE: MI-L Integrated Mapping Problem


David - 

Its not actually the picture box you are seeing, its the reparented MapInfo
window. Either prevent the users resizing the form or put the following code
in the forms resize event.

(From the MapBasic manual) - 

Whether the user is able to resize the Map window depends on how you set up
your application. The sample program, FindZip, places a Map window in a
Visual Basic PictureBox control, so that it cannot be resized. However, you
could reparent a Map window using an MDI interface, which allows the user to
resize the window.  
Note: When the user resizes the Map window, MapInfo does not automatically
reset the map's contents to fill the new window size. Therefore, if your
application allows the user to resize the Map window, you must call the
Windows API function MoveWindow to make the Map window conform to the new
size. 

For example, if your Visual Basic program will run under 32-bit Windows, you
can use the following Visual Basic Declare statement to access the
MoveWindow API function: 

Declare Function MoveWindow Lib "user32" _
  (ByVal hWnd As Long, _
  ByVal x As Long, ByVal y As Long, _
  ByVal nWidth As Long, ByVal nHeight As Long, _
  ByVal bRepaint As Long)  As Long 

When the user resizes the Map window, call MoveWindow. In Visual Basic, a
resize event triggers the Form_Resize(�) procedure; you could call
MoveWindow from within that procedure, as shown in the following example. 
Dim mHwnd As Long 
mHwnd = Val(mapinfo.Eval("WindowInfo(FrontWindow(),12)"))
MoveWindow mHwnd, 0, 0, ScaleWidth, ScaleHeight, 0 

The number 12 corresponds to the MapBasic identifier WIN_INFO_WND. 
ScaleWidth and ScaleHeight are properties of a Visual Basic form,
representing the form's current width and height. Note: The ScaleMode
property must be set to Pixels, so that ScaleWidth and ScaleHeight represent
pixel measurements. 



Paul Crisp

Syntegra
Innovation Place Delta Bank Road Newcastle NE11 9DJ
Tel 0191 461 4522 Fax 0191 460 1987


-----Original Message-----
From: Windeler, David [mailto:[EMAIL PROTECTED]
Sent: 28 February 2003 14:55
To: 'MapInfo-L (E-mail)
Subject: MI-L Integrated Mapping Problem


To whom it may concern:

I have a VB program that links to a table in MapInfo. I run a query and wish
to display the results in a PictureBox frame. I have no problem doing this. 
However, when I resize the pictureBox control using the Form's ReSize event,
I notice that the PictureBox contents (the results of the query displayed as
a browser) do no resize. I was wondering how I would go about resizing the
PictureBox contents when the form is resized.

David Windeler Hons. BSc. Geo, GIS Apps. Specialist
GIS Technician / Applications Specialist
City Of Vaughan

Engineering Department
2141 Major Mackenzie Drive
Vaughan, Ontario
L6A 1T1

Tel. (905) 832-8525 Ext. 8747
Fax (905) 832-6145
E-mail [EMAIL PROTECTED]

http://www.city.vaughan.on.ca




********************************************************************

This email may contain information which is privileged or confidential. If
you are not the intended recipient of this email, please notify the sender
immediately and delete it without reading, copying, storing, forwarding or
disclosing its contents to any other person
Thank you

Check us out at http://www.syntegra.com

********************************************************************


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 5749

Reply via email to