|
-
Mar 11th, 2004, 09:24 AM
#1
Thread Starter
Junior Member
ComboBox (CLEAR and ADDITEM)
What is the code for Clearing ComboBox and adding Item to the Combobox?
-
Mar 11th, 2004, 09:28 AM
#2
Now, not wanting to take the piss, but if you add a combo box to your form, then in the code window type Combo1 then press the . (full stop) you will get a list of properties/methods.
Try it yourself, and see which properties you think may clear a combo box and add an item to a combo box 
Woka
-
Mar 11th, 2004, 09:37 AM
#3
Thread Starter
Junior Member
I've tried putting the "." but then...there isn't any suitable method that I can use.
-
Mar 11th, 2004, 09:40 AM
#4
Frenzied Member
You dont see combo1.additem or combo1.clear?
You sure you have a ComboBox on your form?
-
Mar 11th, 2004, 09:43 AM
#5
Thread Starter
Junior Member
There is only
.Count
.Item
.LBound
.UBound
I'm very sure that it is ComboBox
-
Mar 11th, 2004, 09:46 AM
#6
Frenzied Member
What version of VB?
Zip up your project and upload it.
-
Mar 11th, 2004, 09:49 AM
#7
Fanatic Member
-
Mar 11th, 2004, 09:55 AM
#8
Right...u have a control array of combo boxes.
U copied and pasted a combo onto your form and when VB asked "Do you want to create a control array" you clicked yes.
This means that to get at the props/methods of a combo you would use combo.Item(2) or whatever the index value is of the combo box u want to use. Then press . and u will see all the mthods.
Woka
-
Mar 11th, 2004, 09:57 AM
#9
It's in a control array - muliple controls have the same name, and must be accessed via their Index.
If that isnt what you want, then just open the form in design view, select the control, and remove the value in the Index property. All will then be fine.
If you do want a control array, then you need to use the index, eg: Combo1(0).AddItem "test"
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
|