in combo box string is xxx and yyy and zzz.we have to store the value to each string like xxx=10, yyy=20 and zzz=30. formula is string(xxx)/1.71^(1/2).. if we select xxx formula have to take value 10 or yyy means formula have to take value 20.
How to set value to the combo box using select case or if statement inthis value will used for the formula calculation in the form
Page 1 of 1
2 Replies - 3233 Views - Last Post: 01 September 2010 - 11:15 PM
#1
How to set value to the combo box using select case or if statement in
Posted 01 September 2010 - 03:34 AM
Replies To: How to set value to the combo box using select case or if statement in
#2
Re: How to set value to the combo box using select case or if statement in
Posted 01 September 2010 - 05:30 AM
Using a Select Case statement, you could base the Case off of the Combobox.SelectedItem
That should allow you to then set a value off of the item selected.
If you get stuck, post your code attempt so that someone can give you more in-depth help. We will help you with your problem but we won't write the code for you.
That should allow you to then set a value off of the item selected.
If you get stuck, post your code attempt so that someone can give you more in-depth help. We will help you with your problem but we won't write the code for you.
This post has been edited by CharlieMay: 01 September 2010 - 05:31 AM
#3
Re: How to set value to the combo box using select case or if statement in
Posted 01 September 2010 - 11:15 PM
Perhaps this is what you mean :
dim cboVal, result as Integer
Select Case ComboBox1.Text
Case "xxx"
cboVal = 10
Case "yyy"
cboVal = 20
Case Else
cboVal = 30
End Select
result = cboVal/1.71^(1/2)
MessageBox.Show(result.ToString)
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|