Simple Question

I have a simple question.  I am making a forum(in DX) that has a pull down combo list.  Is there anyway to add all the objects in the Object Navigator, with a simple command.  And if i add objects, it will automaticly add them to the list.

Set
frm = DesktopX.CreateForm
frm.AddPreference "Text1"
frm.Preference("Text1").Type = "ComboList"
frm.Preference("Text1").AddValue Like a command right here that will add everything in the Object Navigator.
frm.Prompt

Thanks 
{EDIT} I found another example.  When you choose the parent/owner, in the Summary tab.  Thats what im talking about how can i have a pull down like that.
3,728 views 8 replies
Reply #1 Top
Hello jlaj1989,

I will pass your inquiry onto technical support and they will get back with you as soon as they can.

Thanks!
Jenny
Reply #2 Top
Ok thanks you very much!
Reply #3 Top
Glad to help!
Reply #4 Top

: I believe the addvalue command unfortunately adds only one entry at a time to your combobox. You could potentially set up a loop in which this command would be called multiple times but physically written in the code only once. This would just depend on how you are retrieving objects to be added into the combo box.

-Mike
[Stardock Support]

Reply #5 Top
Thank you! Can you give we an example please?
Reply #7 Top
Hmm. Sounds like an interesting project.

The pull downs in the Object Property menus are a bit more complex--they don't list themselves for example. But I think you could get a list using a For Each, and then decide if you want to read that into an array and then into your list, or just into the list directly.

Page 12 of the Scripting PDF describes DesktopX Enumerators. I had this pointed out to me once, and am thankful as they are extremely useful. We could read the Object.Names into a Combo-Box thusly:

Dim objElem
For Each objElem In DesktopX.Objects
Control.AddItem objElem.Name
Next


You'll have to figure out how and when to update the list, probably every time you open it, so that it always has all the latest objects listed.

Reply #8 Top
Hey thank you rabidrobot and milksama those where exactly what i was looking for. I have one more question. Can you make the text in a msgbox centered or aligned to the right, instead of to the left?