PDA

View Full Version : VB6 Help


iggybaseball
12-08-01, 09:06 AM
what command can i use so that i can delete words from a combobox?

iggybaseball
12-08-01, 10:42 AM
any1?

turd
12-08-01, 08:49 PM
could u have locked yourself out?

If you don't want the user to be able to modify or delete text in the textbox part of a combobox control, you can set its style to 2 - dropdown list. However, in doing so, you also disable your own ability to do the same, because the text property is read-only at runtime. This means that if the style is set to 2 you cannot set the text property in code and you cannot link the combo box to a database either, because scrolling the database alters the textbox property. The solution is simple: Set the style to 0 - dropdown combo, its locked property to false and add the following to the combobox code:

Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode <> vbKeyUp And KeyCode <> vbKeyDown Then
Combo1.Locked = True
End If
End Sub

' The up-down arrow keys must be allowed to enable
' mouse-less users to scroll the list.
' Unlock the combobox again on key up events:
Private Sub Combo1_KeyUp(KeyCode As Integer, Shift As Integer)
Combo1.Locked = False
End Sub


also here is a link that might be useful:http://www.canadacomputes.com/v3/story/1,1017,3608,00.html?tag=134&sb=282

iggybaseball
12-09-01, 09:07 AM
no i want to make a drop down combo box that allows u to add text to the box and delete text after it is saved in the box. I know how to add it but not how to delete it.

The Coolest
12-12-01, 02:55 PM
combo1.text = ""
combo1.removeitem(combo1.selected) '(or something like that)

iggybaseball
12-12-01, 07:34 PM
thanx a lot, will try this out later:)