|
-
October 22nd, 2001, 04:32 AM
#1
ComboBox Text Property
Hi,
I am having a ComboBox called targetCombo. The first item which shows up is set with
targetCombo.text = "jhg"
The problem is that when I want to change it I get the Error that the Text Property is read only.
How can I change the first choice in the combo box?
One more question:
Depending on a selection in the combo box I want a radio button to enable or disable. How can I make the comboBox selection take action on the radio button?
Please rate if it helps!
* The second mouse gets the cheese.
* Birthdays are good for you. The more you have, the longer you live.
* Always keep your words soft and sweet, just in case you have to eat them.
* Always read stuff that will make you look good if you die in the middle of it.
-
October 22nd, 2001, 04:43 AM
#2
Re: ComboBox Text Property
you have to select the item thru the List property.
combo1.list(1) = "Blah"
Software is like sex, it's better when it's free - Linus Torvalds
Software is like sex, it's better when I get paid for it. - me
-
October 22nd, 2001, 08:00 AM
#3
Re: ComboBox Text Property
You can use combobox.value = "Your text here"
Nicolas Bohemier
-
October 22nd, 2001, 10:43 AM
#4
Re: ComboBox Text Property
If your ComboBox style property is set to DropDropDown List (2) then it is indeed a Readonly box. Set the style to 0 or 1 to be able to enter data into it programattically. To prevent users from keying data when style is 0 or 1, add this to the KeyPress event of the comboBox
private Sub Combo1_KeyPress(KeyAscii as Integer)
KeyAscii = 0
End Sub
John G
-
October 22nd, 2001, 01:19 PM
#5
Re: ComboBox Text Property
option Explicit
private Sub Combo1_Change()
If Combo1.Text = "Item1 - RadioButton Enabled" then
Option1.Enabled = true
else
Option1.Enabled = false
End If
End Sub
private Sub Combo1_Click()
Combo1_Change
End Sub
private Sub Form_Load()
Combo1.AddItem "Item1 - RadioButton Enabled"
Combo1.AddItem "Item2 - RadioButton Disabled"
Combo1.Text = "Item1 - RadioButton Enabled"
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|