Im trying to populate a listbox with the pushpin names, but it's not working out. Has anyone tried this before? Any tips?
This is a discussion on Pushpin Names within the MapPoint Desktop Discussion forums, part of the Map Forums category; Im trying to populate a listbox with the pushpin names, but it's not working out. Has anyone tried this before? ...
Im trying to populate a listbox with the pushpin names, but it's not working out. Has anyone tried this before? Any tips?
Hi,
Can you please be more specific on about what the problem is ?
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
Here's what I did in VBA (Access):
Set List = Me![Cardinal]
List.RowSourceType = "Value List"
Set rstListBox = objMap.DataSets.Item("Cardinal Directions").QueryAllRecords
While Not rstListBox.EOF
strList = strList & """" & rstListBox.Pushpin.Name & """" & ";"
MsgBox "strList is " & strList
rstListBox.MoveNext
Wend
intLength = Len(strList)
List.RowSource = strList
List.Requery
The QueryAllRecords gets the info from the pushpin set. I'm using Access 2000, so I couldn't use AddItem to add the pushpin names to the list box, so I concatenated them into a value list instead. Hope this helps.
Thanks Alexa, most if it makes sence, but I must be completely stupid, query's and I don't get along.
Is there a VB6 article or write-up of this somewhere? I'm pulling my hair out over this simple little thing.
Hi,
Can you please tell what the problem is ? I think many people will help but I can not figure out what the problem is.
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
Hey Wilfried,
Unfortunately the workstation that has mappoint on it is at a different location and doesn't have web access, so next time I'll write down my problems exactly, sorry.
But after reading this post...
http://www.mp2kmag.com/mappoint/disc...hlight=listbox
I think my problem is that I didn't understand DataSets, I think I do now. I need to query each of my pinsets separately. I'll take this post to the other location and try again. It'd be nice if there was a library of simple sample code like this for newbie's to learn from.
Hi,
Reading the document (the URL you posted) made me more clear what your problem was. Problem is I'm not (and many people here) english spoken. If I translate for example you original question then I read: "how to fill a listbox with names?". See? that's the difficult one
good luck !
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
Wilfried,
English is my first language and I mess it up all the time.![]()
It is that simple. Just as you said:
I'm over thinking it and making it more difficult then it needs to be. Tomorrow I'll bring some of the code I have so far, but I just assume delete it, because I think its completely wrong and guiding me in the wrong direction."how to fill a listbox with (pushpin)names?".
Sorry for being so difficult.
Hi,
No youre not difficult. It is a question of language barrier. Please post your code but more important is "what you wants to do" so that it is understandable for people that only know "simple" english like me
My primary language is object pascal, after it it is C, Asm, Clipper, then Flemish, Duch, English, German, ...
If you wants to fill a listbox with all your pushpin names, then just add the names to the listbox at the moment you create you pushpins. Whas this your question ?
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
My VB6 application loads a map into the mappoint control. The map that it loads, has a lot of pushpins already added to it. I want my VB6 app to place the pushpin names in a listbox, so that when the users clicks a pushpin name the map goes to that location.
I have 3 different sets of pushpins, about 80 pushpins in each set. I'm trying to get each set in their own listbox.
I'm really new, so thank you for you patience.
There are currently 1 users browsing this thread. (0 members and 1 guests)