#89715 - 2002-11-26 06:04 PM
Reset contents of combobox
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Is there a way to replace the contents of a combo box...
basically, I have 1 combo box listing all the OUs in my domain, and upon click(change) I want it to update/replace the contents of a second combobox.
|
|
Top
|
|
|
|
#89717 - 2002-11-26 06:48 PM
Re: Reset contents of combobox
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I have that... I need to empty the second box, if the first box is changed again
|
|
Top
|
|
|
|
#89718 - 2002-11-26 06:50 PM
Re: Reset contents of combobox
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Here's some sample code...
code:
Break On CLS $Form = CreateObject("Kixtart.Form") $Form.Size = 220,100
$Combo1 = $Form.ComboBox(,20,30,200) $Combo1.Top = 5 $Combo1.Left = 5 $Combo1.Additem (@WKSTA) $Combo1.OnClick = "fnChangeBox()"
$Combo2 = $Form.ComboBox(,20,30,200) $Combo2.Top = $Combo1.Bottom $Combo2.Left = 5 $Combo2.AddItem (UserID1) $Combo2.AddItem (UserID2)
$Form.Center $Form.Show While $Form.Visible $nul=Execute($Form.DoEvents) Loop
Function fnChangeBox() $Combo2.Clear $Combo2.AddItem (@USERID) EndFunction
|
|
Top
|
|
|
|
#89720 - 2002-11-26 06:57 PM
Re: Reset contents of combobox
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
combo.clear
thanks
In process of writing a kixform front end for remotely inventoring computers for help desk use. (mostly WMI based)
Including button to start SMS remote control/vnc Macro buttons to execute common functions against remote PCs (copying specific files, rebooting, etc)
|
|
Top
|
|
|
|
#89721 - 2002-11-26 07:03 PM
Re: Reset contents of combobox
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Rad, might also want to check into pre-selecting an item from each list Two ways to do that:
Using index numbers:
$Form.Show $Combo1.ListIndex = 0 $Combo2.ListIndex = 1
Using values:
$Form.Show $Combo1.Value = @WKSTA $Combo2.Value = UserID2
Little itty-bitty form there ...
-Shawn
|
|
Top
|
|
|
|
#89723 - 2002-11-26 07:13 PM
Re: Reset contents of combobox
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I was wondering about that...
Just need to display the contents, not try to accept input
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 1188 anonymous users online.
|
|
|