|
-
Oct 12th, 2000, 05:16 PM
#1
How do I stop users typing into text of the combo box?
I need the following:
When the form is opened, the list will be loaded in the combo which is sorted and combo.text should be the same as the first item of the list. (THIS WORKS OK)
The user should only be able to choose one of the items from the list. The user should not be able to type or paste text into combo.text. (THIS IS WHERE I HAVE GOT A PROBLEM)
Thanks.
-
Oct 12th, 2000, 05:19 PM
#2
_______
<?>
Set the locked propery of the combo box to true.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Oct 12th, 2000, 05:32 PM
#3
"Locked" property not good...
If I set the locked property to true, then I cannot choose another entry by clicking at the list, so this is not good.
Any other ideas?
-
Oct 12th, 2000, 05:47 PM
#4
Set the style to Dropdown List
-
Oct 12th, 2000, 06:20 PM
#5
NOT WORKING :(((
I could not get it to work with both suggestions. To see what is my problem, create a new form with the Combo1 control. Set the properties of Combo1 as Locked = True and Style = 0 - Dropdown Combo.
Paste the following lines in the form:
Private Sub Form_Load()
Combo1.Text = "First Choice"
Combo1.AddItem "First Choice"
Combo1.AddItem "Second Choice"
Combo1.AddItem "Third Choice"
Combo1.AddItem "Fourth Choice"
End Sub
Now run the program. Click on combo, the drop down list appears. Try to click on the entry of the list - impossible.
-
Oct 12th, 2000, 06:30 PM
#6
_______
<?>
The text they enter is only for finding purposes.
It helps the user find their choice easier.
Ie. if you type in T then Third Choice comes to the
front.
Combo1.AddItem "First Choice"
Combo1.AddItem "Second Choice"
Combo1.AddItem "Third Choice"
Combo1.AddItem "Fourth Choice"
'instead of this
'Combo1.Text = "First Choice"
'try this
Combo1.ListIndex = 0
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Oct 12th, 2000, 06:36 PM
#7
Set the dropdown style to 2.
-
Oct 12th, 2000, 06:50 PM
#8
_______
<?>
Forgot to mention that. I have it set to 2.
However, that does not prevent the user typing info
but as I said it is only for finding not retaining.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Oct 12th, 2000, 07:11 PM
#9
Thanks, guys, that has sorted it.
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
|