mysql中的vb.net组合框值(vb.net combobox values in mysql)

编程入门 行业动态 更新时间:2024-10-28 09:27:12
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 if

i 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 Sub

In 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 sub

in 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

更多推荐

本文发布于:2023-08-04 19:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1420736.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:组合   vb   mysql   net   values

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!