Make combobox not editable in windows application

roupin Messages postés 7 Date d'inscription samedi 1 mars 2003 Statut Membre Dernière intervention 24 août 2004 - 24 août 2004 à 10:09
roupin Messages postés 7 Date d'inscription samedi 1 mars 2003 Statut Membre Dernière intervention 24 août 2004 - 24 août 2004 à 14:58
Dear all, i'm newbies to .net (VB) development and i've got a little question. (i use microsoft visual basic .NET)

i created a form with a comboxbox. When i launch it, the comboxbox is editable. I'd like it to be non-editable. Could you tell me what's the way to get it non-editable? (i'd like it to appear as a 'select' in html; so that you can not type text into ;-)

Thanks in advance for your help,

Sebastien.

3 réponses

Clonk Messages postés 278 Date d'inscription mardi 22 janvier 2002 Statut Membre Dernière intervention 29 août 2006
24 août 2004 à 10:31
Not sure it works the same way as under VB 6.0, but within it, just use :

Private Sub Combo1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
0
econs Messages postés 4030 Date d'inscription mardi 13 mai 2003 Statut Membre Dernière intervention 23 décembre 2008 24
24 août 2004 à 10:31
I don't use Visual Basic .NET, but it might be similar to classic VB

ComboBox.Style = 2 ' DropDownList

This property makes the comboBox appear like a HTML select balise.

Manu
0
roupin Messages postés 7 Date d'inscription samedi 1 mars 2003 Statut Membre Dernière intervention 24 août 2004
24 août 2004 à 14:58
it was nearly nice ;-) the right parameter for .net is the following:

ComboBox.DropDownStyle = 2

thanks very much for your help... @++

seb.
0
Rejoignez-nous