如何使用下拉列表编写“if else”语句并在textBox上显示结果?
这是saveButton的半部分代码:
err_no = db.ExecuteInsert("INSERT INTO EFolder (No, working, Exp, points) VALUES("'" & db.sqlstr(drplstWorking.SelectedValue),
"'" & db.sqlstr(drplstExp.SelectedValue),
"'" & db.sqlstr(txtpoints.Text),
Session("CnnStr").ToString)
这里我正在尝试编写if else
语句
Protected Function Mix() As Long
Dim working As Boolean
Dim Exp As String
working = drplstWorking.SelectedValue
exp = drplstExp.SelectedValue
If (drplstWorking.SelectedValue.text) = "Y" and (drplstExp.SelectedValue.Text) = 1
Then
txtpoints.Text = "5"
End If
End Function
答案 0 :(得分:0)
你可以试试这个
if drplstWorking.selectitem.text=("Y") and drplstExp.selectitem.text=("1") then
txtpoints.Text = "5"