Simple Question

Wednesday, August 9, 2006 by jlaj1989 | Discussion: DesktopX

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.
jennybean
Reply #1 Friday, August 11, 2006 3:36 PM
Hello jlaj1989,

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

Thanks!
Jenny
jlaj1989
Reply #2 Friday, August 11, 2006 3:47 PM
Ok thanks you very much!
jennybean
Reply #3 Friday, August 11, 2006 3:48 PM
Glad to help!
milksama
Reply #4 Friday, August 11, 2006 4:48 PM

: 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]

jlaj1989
Reply #5 Friday, August 11, 2006 4:51 PM
Thank you! Can you give we an example please?
milksama
Reply #6 Friday, August 11, 2006 4:55 PM

There's an example of for loops here:

http://www.programmershelp.co.uk/vbforloops.php

The index variable that you use in the loop changes with each iteration, so this would be perfect when used to index into an array.

-Mike
[Stardock Support]

rabidrobot
Reply #7 Saturday, August 12, 2006 3:41 PM
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.

jlaj1989
Reply #8 Sunday, August 13, 2006 5:47 PM
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?

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01