mysql中的vb.net组合框值(vb.net combobox values in mysql)
最近我创建了一个pos,但我想使用组合框而不是单选按钮来选择税收选项,但我如何选择我想要的税并做数学:这是我的单选按钮代码,我想这样做但是与combobox
Dim SellPrice as Double Dim Tax as Double Dim FinalPrice if radiobutton1=checked=true than Final price *=Sellprice *0.18 else if radiobutton2=checked=true than Final price *=Sellprice *0.5 end if我想做同样的事情,但使用组合框而不是radiobutton
Recently i created a pos but i want to use a combobox rather than a radio button to select a tax option but how can i choose the tax i want and do the mathematics: here is my code of radio button , i want to do it but with combobox
Dim SellPrice as Double Dim Tax as Double Dim FinalPrice if radiobutton1=checked=true than Final price *=Sellprice *0.18 else if radiobutton2=checked=true than Final price *=Sellprice *0.5 end ifi want to do the same but to use combobox rather than radiobutton
最满意答案
在您的表单加载:
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load ComboBox1.Items.Add("0.18") ComboBox1.Items.Add("0.5") 'Add other values if you wan End sub在验证按钮中:
Private Sub BtnValidate_Click(sender As Object, e As EventArgs) Handles BtnValidate.Click Dim SellPrice As Double Dim Tax As Double Dim FinalPrice If ComboBox1.SelectedIndex > -1 Then Tax = Convert.ToDouble(ComboBox1.Text) FinalPrice *= SellPrice * Tax End If End SubIn your form load :
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load ComboBox1.Items.Add("0.18") ComboBox1.Items.Add("0.5") 'Add other values if you wan End subin your validation button :
Private Sub BtnValidate_Click(sender As Object, e As EventArgs) Handles BtnValidate.Click Dim SellPrice As Double Dim Tax As Double Dim FinalPrice If ComboBox1.SelectedIndex > -1 Then Tax = Convert.ToDouble(ComboBox1.Text) FinalPrice *= SellPrice * Tax End If End Sub更多推荐
发布评论