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

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

Reply via email to