Page 1 of 1 1
Topic Options
#91639 - 2003-03-03 08:14 PM KixForms Quickie?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
I am trying to populate a combobox with a list of values from an array of 7 elements. I want to default the selection to one of the elements based on what another variable contains.

The "match" variable will contain exactly the same text as one of the combo-box elements. I assume that I need to use the "$cboChoice.Selected" property, but I'm not sure how to specify WHICH element in the combo box to apply it to. The online help is not available for that topic, and I can't find an example in the sample scripts (yet).

Here's what I've got so far - don't know how to make the item Selected when I find it.
code:
 
$Default = "Green" ; set elsewhere...

$aryTYPES = "Red", "Green", "Blue"
For Each $Tmp in $aryTYPES
$cboType.AddItem($Tmp)
If $Tmp = $Default
; mark this item SELECTED

; HOW???

EndIf
Next

Thanks!

Glenn

PS - is any other KixForms documentation available that I'm not looking at??
_________________________
Actually I am a Rocket Scientist! \:D

Top
#91640 - 2003-03-03 08:18 PM Re: KixForms Quickie?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Here u are :



$Default = 1 ; set elsewhere... but set the Array Element Number !!!

$aryTYPES = "Red""Green""Blue"

;create the Combo before  [Wink]
$cboType.List = $aryTYPES ; populate Combo
$cboType.ListIndex = $Default ;sets marked item to $Default



hth
Jochen

[ 03. March 2003, 20:19: Message edited by: jpols ]
_________________________



Top
#91641 - 2003-03-03 08:19 PM Re: KixForms Quickie?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hi Glenn,

Heres a shortcut for doing both those thingies:

code:
$cboType.List = "Red", "Green", "Blue"

$cboType.Text = "Green"

-Shawn

Top
#91642 - 2003-03-03 08:20 PM Re: KixForms Quickie?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
wahey Shawn ... Youre online ?

{Hijacking Post}
_________________________



Top
#91643 - 2003-03-03 08:59 PM Re: KixForms Quickie?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Thanks, guys..

Where, if not on the KixForms site, would you get this info? Is it close enough to use VB docs? (not that I'm too good at VB, but they're available)

Gonna go with Shawn's suggestion, as I'd have to write additional code to determine the index of the default. The value is queried from a remote system, but I didn't want to make the sample that complex. But - I now have two ways documented to set the cbo default. [Big Grin]

Shawn: - Just gotta ask.. (since your code post wasn't in color) Did the use of the kix code formatter relate in any way to your previous Avatar (or vice-versa)? [Wink]

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#91644 - 2003-03-03 09:10 PM Re: KixForms Quickie?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Use ASCAN or the IsInArray() UDF to find the index of an element in an array.
_________________________
There are two types of vessels, submarines and targets.

Top
#91645 - 2003-03-03 09:38 PM Re: KixForms Quickie?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Glenn - avitar & color ?

Yeah actually, it did relate to postprep a little bit I guess - I asked Jose if he could add a splash of color and this was while Jochen and Jooel were developing PostPrep - I don't have PostPrep handy where I am right now, thats why I didn't use it.

Ahoy Captain - I'm never too far away from the family here at korg !

-Shawn

ps

Docs ? I'm working on the CHM as we speak. Also trying to get the next version of kixforms out the door.

[ 03. March 2003, 21:40: Message edited by: Shawn ]

Top
#91646 - 2003-03-03 10:18 PM Re: KixForms Quickie?
Jose Offline
Seasoned Scripter
*****

Registered: 2001-04-04
Posts: 693
Loc: Buenos Aires - Argentina
Shawn You got your hat back again !! [Wink] .
I can see the pills finally made effect your color came back too.
Pass me the rehab clinic phone number I might need it........soon. [Cool]

If any makeup change is required please let me know. IŽll be glad. Thanks.

[ 03. March 2003, 22:55: Message edited by: jose3 ]
_________________________
Life is fine.

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.056 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org