MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




How to avoid mapppoint control focus when pressing a Key

This is a discussion on How to avoid mapppoint control focus when pressing a Key within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I want to use several functional Keys for some special features of my Mappoint control application. However, I cannot avoid ...


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

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 08-21-2002
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
How to avoid mapppoint control focus when pressing a Key

I want to use several functional Keys for some special features of my Mappoint control application. However, I cannot avoid the focus on mappoint control. I tried to set the Property KeyPreview of the main form to true, but my main form still cannot get the KeyDown event, e.g. When pressing F1, the mappoint online help will show up. This is not what I want. Any suggestions and ideas.
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 08-22-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
You'll probably have to use a API function to trap for the keypress. The mappoint control does not have a keypress event like a command button for example. If a command button had the focus you could trap the F1 key like this:

Private Sub Command1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF1 Then
MsgBox "F1 Pressed" 'do whatever here
End If
End Sub

We are already kind of out of the scope of this forum so I'll leave it at that.
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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 12-22-2002
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 35
hehheheh another question that i don't have to ask (c:= the answer is as suspected though. is this an easy task (the key interceptor)?

they really make you jump through hoops to releive your VB app from the grips of the built in mappoint interface.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 12-23-2002
Member
Yellow Belt
 
Join Date: Aug 2002
Posts: 45
A bug or limitation of Mappoint?

I tried several ways including Window 32 API and subclass etc, but still failed.

Who has a solution, please help me!

Any suggestions are appreciated very much!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 01-05-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
set the keypreview to true for your form and use this code :

Private Sub Mpc_GotFocus()
Me.SetFocus
End Sub

Private Sub Mpc_MouseMove(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
Me.SetFocus
End Sub

"Mpc" is the name of the Mappoint control in this case

This work fine for me, all the keys are intercepted by the form except the four arrows keys, I dont know why only this keys could not be intercept but for all other key it's good.

Bye
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 01-06-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 35
great! thanks for the tip.

cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 01-11-2003
Member
Yellow Belt
 
Join Date: Aug 2002
Posts: 45
Thanks

Thank you very much, Coyote!
The remaining issue is need to place the mouse pointer on the map before you press the key.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 01-13-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Re: Thanks

Quote:
Originally Posted by dzhong
Thank you very much, Coyote!
The remaining issue is need to place the mouse pointer on the map before you press the key.
In my case I use Mappoint in full screen in my car (www.media-car.fr.st) then the mouse is always on the map :)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 01-13-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Re: Thanks

Quote:
Originally Posted by Anonymous
Quote:
Originally Posted by dzhong
Thank you very much, Coyote!
The remaining issue is need to place the mouse pointer on the map before you press the key.
In my case I use Mappoint in full screen in my car (www.media-car.fr.st) then the mouse is always on the map :)
It was me :)
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
avoid, control, focus, key, mapppoint, pressing


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
Mapppoint Technical Workshop in Paris Mohamed MapPoint 2006/2009 Discussion 0 06-08-2006 03:25 AM
Delphi/Mappoint - Modal Form looses Focus & sent to back PinnacleDev MapPoint 2006/2009 Discussion 2 12-06-2004 10:35 AM
How to programmatically draw a rectangular focus box? Alex Chow MapPoint 2006/2009 Discussion 5 12-12-2003 04:53 AM
How to avoid basemaps? Anonymous MapPoint 2006/2009 Discussion 2 04-02-2003 12:12 PM
MappPoint Data Updates jonesm13 MapPoint 2006/2009 Discussion 1 09-30-2002 11:25 AM


All times are GMT -5. The time now is 01:55 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Banff Ski Holidays
Banff ski holidays offer some of the best on and off-piste runs in the world. This is combined with excellent facilities and infrastructure to give you a great holiday.

Travel Agent UK
Travel Counsellors was named UK's Best Travel Agent at the Guardian Unlimited travel awards. Whatever your travel needs we can help.

Cape Town Cheap Flights
Thinking about visiting Cape Town. Cheap flights are hard to find unless you visit dealchecker.co.uk. We'll shop around so you don't have to.

Jamaica Holidays
Jamaica holidays give you the chance to enjoy the vibrant cultural heritage and wonderful laid back atmosphere of the Caribbean. Book here!

Morocco
Gain insight on your holiday destination with the ULookUBook travel guides. Find out about Morocco and its customs online. Make an informed decision when you make a booking.

Comparison Holidays
Travel.co.uk is a travel comparison service which makes it easy for you to find and plan the best holidays.

Cheap Holidays to Fuerteventura
Don't do it the expensive way! Get information on cheap holidays to Fuerteventura at On The Beach, and enjoy the Canary Islands' best!


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