Community of VE/MapPoint Users and Developers
This is a discussion on help on converting vba code to visaul basic 2005 express within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Can someone help me please convent this vbaccess mappoint 2004 code to visual basic 2005 code as im trying to ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| help on converting vba code to visaul basic 2005 express Can someone help me please convent this vbaccess mappoint 2004 code to visual basic 2005 code as im trying to convert my database to visual basic 2005 express edition many thanks if you can help me Code: Option Compare Database
Private objMap As MAPPOINT.MappointControl
Private objRoute As MAPPOINT.Route
Private objSA As MAPPOINT.StreetAddress
Private objPush As Pushpin
'Private objway As Waypoints
Private oLoc As Object
Private Sub cmdPlot_Click()
If txtAddress <> "" Then
ApplyPoint
End If
End Sub
Private Sub Form_Load()
Set objMap = Mapctl.Object
objMap.NEWMAP geoMapEurope
End Sub
Public Function ApplyPoint()
If objMap Is Nothing Then Set objMap = Me!Mapctl.Object
Set objSA = objMap.ActiveMap.ParseStreetAddress(PICKUPADDRESS & " , " & PICKUPTOWN & " , " & PICKUPCOUNTY & " , " & PICKUPPOSTCODE)
Set oLoc = objMap.ActiveMap.FindAddressResults(objSA.Street, objSA.City _
, , objSA.Region, objSA.PostalCode)
If Not oLoc Is Nothing And oLoc.ResultsQuality <> geoNoResults Then
Set objPush = objMap.ActiveMap.AddPushpin(oLoc(1).Location, Me.PICKUPCUSTOMER)
objPush.BalloonState = geoDisplayName
objMap.ActiveMap.ActiveRoute.Waypoints.Add oLoc(1) 'Adds Awaypoint to map
objPush.Location.GoTo
Set objPush = Nothing
Set oLoc = Nothing
End If
End Function
|
| |||
| triptime prob
ok well i have just about converted the code above to vb.net still got a problem with the triptime code for vb.net 2005 in vba code i set a text box to short time with a input mask 00:00;0;_ then the code me.textbox = objmap.activemap.activeroute.triptime say trip is 2 hours 30min this shows in the textbox 2:30 now in vb.net 2005 i do textbox.text = objroute.triptime i get back 0.235677889 if you add the numbers up that show in the textbox they will make up to 2hours 30 min how do i get the same result as in the vba code can anyone help on this please |
| |||
|
Hi, > i get back 0.235677889 0.2 is a lot more that 2:30. Please elaborate your question.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| more info
im trying to get the textbox in vb.net to display the triptime like in summary 2hours 30 min in the textbox like this 2:30 the problem is that when i get back the time in textbox its (0.234237 sample numbers only) if you add up the numbers after the 0. this is the total time from point a to point b how do i get it to display in the textbox hours and min 2:30 |
| |||
|
Hi, there are 86400 seconds in a day, and 1440 minutes in a day. the dotNet clock is very simple, it is just the day count like in Delphi. So just multilpy it to get minuts or seconds. 0.5 is 6 hour etc... I hope I did understeand your question right !
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Quote:
|
| ||||
| Re: help on converting vba code to visaul basic 2005 express
Did you try to send nmilne a message via e-mail ? http://www.mapforums.com/nmilne-member.html It looks like the last time the person visited the board was six months ago. In any case, take a look at the examples and articles at -- MapPoint Articles - MP2K Magazine Also, I would recommend the book -- Programming MapPoint in .NET I did not have too much trouble with VB.NET and MapPoint 2004/2006, but I remember when I did have trouble it was frustrating to troubleshoot. Eric |
| |||
| Re: help on converting vba code to visaul basic 2005 express
Hi, Quote:
Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| 2005, basic, code, converting, express, vba, visaul |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| converting lat lon to x y | Dazzer | MapPoint 2006/2009 Discussion | 6 | 08-14-2008 06:03 AM |
| Basic - Zip Code Data (Bubble Diagram) | robertuva | MapPoint 2006/2009 Discussion | 1 | 09-27-2005 04:01 PM |
| Converting XY to Lat Long | Anonymous | MapPoint 2006/2009 Discussion | 1 | 11-22-2004 03:35 AM |
| Autoroute express | tanguy_laverdure | MapPoint 2006/2009 Discussion | 0 | 04-16-2004 05:30 AM |
| Controlling Autoroute from Visual Basic code | Anonymous | MapPoint 2006/2009 Discussion | 1 | 01-26-2004 11:47 AM |