Home > Software engineering >  Vb.net using the combo box
Vb.net using the combo box

Time:09-29

Such as topic, how do I will return to information of the combo box set to my custom numerical or text?

For example, I created three combo box set, were've, we, er, but I think at the time of selected've, return a value for "eight", or returns a string "LKJ" rather than the index value, is also not in the combo box set text, excuse me what is the easiest way? Thank you

CodePudding user response:

To make a combo box to inheritance, want to go you've turned into 8 or LKJ,

CodePudding user response:

I use the VB6.0 by use of, if there are any similar this kind of situation, I processing method is:
In addition to create an array, the array element to the value of the corresponding to the combo box (drop-down list box), list items,
Drop-down list box list item, initialized before the "use" is necessarily, this time also corresponding to the value of the initialization of array elements,
When need to select the project data read, instead of in the drop-down list box ListIndex values from an array of values,

I think in the.net, this approach applies

CodePudding user response:

refer to the second floor Chen8013 response:
I use VB6.0 by use of, if you encounter similar this kind of situation, I processing method is:
In addition to create an array, the array element to the value of the corresponding to the combo box (drop-down list box), list items,
Drop-down list box list item, initialized before the "use" is necessarily, this time also corresponding to the value of the initialization of array elements,
When need to select the project data read, instead of in the drop-down list box ListIndex values from an array of values,

I think in the.net, this approach applies
well, I tried it can be a little trouble, thank you

CodePudding user response:

Now with inheritance, you can directly encapsulation in control, the relation between
If is fixed conversion, use the SELECT CASE,
# 2 say is, if is the dynamic conversion, array,
In fact VB6 ComboBox. ItemData () is similar purposes, only with its type is Long much,
  • Related