MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Alignment of the control on my form

This is a discussion on Alignment of the control on my form within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi all, if the user maximizes the form, the mapcontrol stays the same size. I want to align the control ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-17-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 39
Alignment of the control on my form

Hi all,

if the user maximizes the form, the mapcontrol stays the same size. I want to align the control on the form. How to do this. In Delphi this would be Alignment Client. How to do this in VB with the MapPoint Control?

Thanks


Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 09-24-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Alignment of the control on my form

Assuming that you have a Mappoint Control MPCtl1 on your form and you want the control to fill the entire screen, you could do the following with Visual Basic:

Code:
 Private Sub Form_Resize()
    Dim reEntered as Boolean

    'Prevent error message when resizing to negative value
    If  reEntered or Me.WindowState = vbMinimized Then Exit Sub

    reEntered = true
   
    MPCtl1.Width = Me.ScaleWidth
    MPCtl1.Left = Me.ScaleLeft
    MPCtl1.Height = Me.ScaleHeight
    MPCtl1.Top = Me.ScaleTop
    
 End Sub
If you want to allign the control with other controls on the form, make adjustments as necessary. For example, if you had a combobox that you wanted to appear above the mappoint control, you would align the combobox using its left and top properties, then set the mappoint control properties:

Code:
   Dim vPad as Long
   vPad = 40 'vertical padding between controls 
   MPCtl1.Top = Combo1.Top + Combo1.Height + vPad
   MPCtl1.Left = Me.ScaleLeft
   MPCtl1.Width = Me.ScaleWidth
   .
   .
   .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 09-25-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 39
Sorry, forgot to post

Hi all, hi Guest,

yep, that's what I did. Forgot to post the solution.Sorry for that .
I found it in a vb forum, of course. Here's exactly my code for Form_resize:

Form_Main.MappointControl1.Width = Me.ScaleWidth
Form_Main.MappointControl1.Height = Me.ScaleHeight


Thanks,

Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
alignment, control, form


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
summary to access form help please nmilne MapPoint 2006/2009 Discussion 3 01-15-2006 03:22 PM
How can I use the Symbols (i.e. car) on a VB form? Anonymous MapPoint 2006/2009 Discussion 1 03-01-2005 01:23 PM
the map is empty after Show/Hide form with MapPoint control Anonymous MapPoint 2006/2009 Discussion 1 03-25-2004 03:24 PM
MapPoint Control align in Form blackmap MapPoint 2006/2009 Discussion 0 02-06-2003 10:26 AM
MapPoint OCX control does not work on a .Net MDI form. clackclack MapPoint 2006/2009 Discussion 5 12-05-2002 11:17 PM


All times are GMT -5. The time now is 05:59 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Costa Brava Holiday
Beautiful kilometres of sandy beaches await you should you choose a Costa Brava holiday through UlookUbook!



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59