Messagebox无法正常工作 [英] Messagebox not working correct
本文介绍了Messagebox无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Dim ans As DialogResult = MessageBox.Show(Me,"This Invoice will be changes to the new customre Name", "important warning", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
If DialogResult.No Then
TxtCustNo.Text = OldC_No
TxtCusName.Text = OldC_Name
CmbCustName.Visible = False
CalcChing()
canclos = True
Exit Sub
ElseIf DialogResult.Yes Then
TxtCustNo.DataBindings.Clear()
TxtCustNo.DataBindings.Add(New Binding("Text", CustomersBindingSource, "CustID", True))
TxtC_Debit.DataBindings.Clear()
TxtC_Debit.DataBindings.Add(New Binding("Text", CustomersBindingSource, "Debit", True))
TxtC_Cridet.DataBindings.Clear()
TxtC_Cridet.DataBindings.Add(New Binding("Text", CustomersBindingSource, "Cridet", True))
TxtC_Balance.DataBindings.Clear()
TxtC_Balance.DataBindings.Add(New Binding("Text", CustomersBindingSource, "Balanc", True))
TxtCusName.DataBindings.Clear()
TxtCusName.DataBindings.Add(New Binding("Text", CustomersBindingSource, "CustName", True))
TxtCusName.Text = CmbCustName.Text
CmbCustName.Visible = False
我的尝试:
当我按是它什么都不做
如果我将condtion替换为if dialogResult.Yes Then并按否 它也什么都不做
我的意思是它仅处理第一个条件
如何解决此问题?
提前感谢
What I have tried:
when I press "Yes" it's do nothing
if I replace condtion to be "if dialogResult.Yes Then" and press "No" also it's do nothing
I mean that it deal only with the first condition
How can i resolve this problem?
Thank in advance
推荐答案
尝试使用
Dim ans As DialogResult = MessageBox.Show(Me,"This Invoice will be changed to the new customer Name", "important warning", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
If ans = DialogResult.No Then
...
请参阅: vb.net - 带有YesNoCancel的MessageBox - No&取消触发相同的事件 - 堆栈溢出 [ ^ ]
谢谢RickZeeland我将使用此示例来检查问题所在
Thanks RickZeeland I will use this sample to check where is the problem
这篇关于Messagebox无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文