MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Disable close button

This is a discussion on Disable close button within the Development forums, part of the MapPoint 2006/2009 Discussion category; Is there a way to disable the Close button when opening MapPoint via VB/VBA so that the user cannot close ...


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

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 10-24-2008
Junior Member
Yellow Belt
 
Join Date: Sep 2008
Posts: 21
Disable close button

Is there a way to disable the Close button when opening MapPoint via VB/VBA so that the user cannot close MapPoint while my application is waiting for the user to approve the optimized order, etc.?

Basically, I do this in VBA:

1. Instantiate MP as an app
2. Create a new route
3. Populate the route with Waypoints
4. Allow the user to modify the order of Waypoints.
5. In my app, ask the user to approve/discard the new stop order.
6. If approved, update records in my DB to match the new stop order.
7. Close MP (via VBA).

The problem comes when the user closes MP manually anywhere between #3 and #7, and then I have to trap a variety of errors that can occur as a result (e.g. MP is no longer open when my app references the ListPosition property of a Waypoint).
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 10-24-2008
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,530
Blog Entries: 1
Re: Disable close button

What if you use VB and put the MapPoint control on a VB form?

That way they could not close MapPoint except by closing your whole application... (or ctrl-alt-del / kill). However, I think your application could disable the close button..

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
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 10-24-2008
Junior Member
Yellow Belt
 
Join Date: Sep 2008
Posts: 21
Re: Disable close button

That was my first attempt. I suppose I should have been more accurate. This is actually VBA in Access, not VB itself, and here is a snippet from the MP2009 help file:

"In MapPoint 2009, the MapPoint Control is supported only in Visual Basic 6.0. Consequently, the MapPoint Control is not supported in Visual Basic for Applications"

Being stubborn, I tried anyway and found that I can add the reference but am unablel to insert it onto a form in Access, so I am stuck with the MP Object Library. This is my first attempt at integrating MP with Access, so I am guessing that the Map Control may have been available with earlier version of MapPoint.
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 10-24-2008
Junior Member
Yellow Belt
 
Join Date: Sep 2008
Posts: 21
Re: Disable close button

Something that would work just as well would be to capture the processID of MapPoint when it is instantiated in VBA. Then I could check to see if that process is still active before running any code that assumes it is running and present the user with a better message than the system error messages about objects not found, etc.
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 10-24-2008
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,530
Blog Entries: 1
Re: Disable close button

There are some examples of using MapPoint in an Access form at --

MapPoint Articles - MP2K Magazine

Search for "access" on this page, articles with Access examples should have Access in the title.

It's been a while, but in particular, take a look at John Washenberger's article and my P.F. Chang's article.

hope this helps,
Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
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
button, close, disable


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
How can I hide or disable the optimisation button? stephenmillington MapPoint 2006/2009 Discussion 0 08-30-2005 06:18 AM
Remove Close Button Dazzer MapPoint 2006/2009 Discussion 0 04-01-2004 06:56 AM
Disable left mouse button dearmhr MapPoint 2006/2009 Discussion 0 12-22-2003 11:48 AM
Disable Right mouse button Fisherman´s Friend MapPoint 2006/2009 Discussion 2 12-17-2003 09:48 AM
Disable right mouse button Anonymous MapPoint 2006/2009 Discussion 3 09-10-2003 06:09 AM


All times are GMT -5. The time now is 03:58 AM.


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


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