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 6 of 6

How do I get Focus on the Map without a click?

This is a discussion on How do I get Focus on the Map without a click? within the MapPoint Desktop Discussion forums, part of the Map Forums category; My problem is to get focus on the map so I can use the rolling mouse directly - that is ...

  1. #1
    kaod is offline Junior Member White Belt
    Join Date
    Nov 2006
    Posts
    3

    Smile How do I get Focus on the Map without a click?

    My problem is to get focus on the map so I can use the rolling mouse directly - that is without first making a click on the map. I have tried 'MyMap.SetFocus' - it seems that you have the focus on the map but you must first click on the map. Does anyone have something to suggest?
    Thanks in advance

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: How do I get Focus on the Map without a click?

    Hi,

    No I tryed also Focus() and Select() but this seems not to work. Maybe a solution is to send a mouse click to the control ?

  3. #3
    kaod is offline Junior Member White Belt
    Join Date
    Nov 2006
    Posts
    3

    Question Re: How do I get Focus on the Map without a click?

    Quote Originally Posted by Wilfried View Post
    Hi,

    No I tryed also Focus() and Select() but this seems not to work. Maybe a solution is to send a mouse click to the control ?
    Hi - It Did not work what I can see. Have you any further suggestions?
    Call PostMessage(Form1.hwnd, &H201, 0, &H6400C ' MyMap i Can't user.hwnd. I use the Form instead. Does not work.
    Call PostMessage(Me.Text3.hwnd, &H201, 0, 0) ' Postnumber. It works - focus there (mouseclick give you focus).
    Regards Katarina

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: How do I get Focus on the Map without a click?

    Hi Katarina,

    Form1.hwnd is the form's windows handle. Maybe try the MapPoint component's windows handle ? eg if you have named it MP then try MP.Handle

  5. #5
    kaod is offline Junior Member White Belt
    Join Date
    Nov 2006
    Posts
    3

    Cool Re: How do I get Focus on the Map without a click?

    Quote Originally Posted by Wilfried View Post
    Hi Katarina,

    Form1.hwnd is the form's windows handle. Maybe try the MapPoint component's windows handle ? eg if you have named it MP then try MP.Handle
    Hi !
    I have tried it before - I cannot find any Handle !?
    By a lucky chance I found that objPin.Select will work that is the map is in focus. But just once! If you try the code again it will not work.
    Any ideas?
    Regards
    /Katarina

    Here is my code for a button
    Private Sub Command1_Click()
    sK = "Sweden"
    Set objFindOlikaKartor = objMap.FindPlaceResults(sK)
    Set oLoc = objFindOlikaKartor.Item(1)
    ' oLoc.GoTo
    Set objPinPlats = objMap.AddPushpin(oLoc)
    objPinPlats.Symbol = 28
    objPinPlats.Highlight = False
    objPinPlats.Name = sK
    objPinPlats.BalloonState = geoDisplayBalloon
    objPinPlats.Select
    '
    sK = "Germany"
    Set objFindOlikaKartor = objMap.FindPlaceResults(sK)
    Set oLoc = objFindOlikaKartor.Item(1)
    ' oLoc.GoTo
    Set objPinPlats = objMap.AddPushpin(oLoc)
    objPinPlats.Symbol = 28
    objPinPlats.Highlight = False
    objPinPlats.Name = sK
    objPinPlats.BalloonState = geoDisplayBalloon
    objPinPlats.Select
    ' first time Focus on the map ("Germany") second time no Focus.
    Exit Sub

    End Sub

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: How do I get Focus on the Map without a click?

    Hi Katarina,

    I think you use the object model. Dont know if you have a Handle property. You have one when you use the activeX component.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Delphi/Mappoint - Modal Form looses Focus & sent to back
    By PinnacleDev in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 12-06-2004, 11:35 AM
  2. Long/Lat from click.
    By Milo in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 10-29-2004, 08:32 AM
  3. How to add click event for VB.Net ?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 12-31-2003, 01:15 AM
  4. How to programmatically draw a rectangular focus box?
    By Alex Chow in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 12-12-2003, 05:53 AM
  5. How to avoid mapppoint control focus when pressing a Key
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 01-13-2003, 07:45 PM

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