Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

Alignment of the control on my form

This is a discussion on Alignment of the control on my form within the MapPoint Desktop 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 ...

  1. #1
    blackmap is offline 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

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    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
       .
       .
       .

  3. #3
    blackmap is offline 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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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