为什么这没用? [英] Why this no work?

查看:72
本文介绍了为什么这没用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有标签的winform。在tabA上我有一个名为

nbrBalDue的字段。在tabA上的按钮的Click事件中,我有以下代码


Me.nbrBalDue.Value = 66


当我点击按钮时evertyhing按预期工作。现在的BalDue字段

的值为66.


但是,如果我在TabB上添加了另一个按钮,其中包含相同的代码并单击

吧,BalDue没有更新到66.


可以解释为什么?

I have a winform with a tab on it. On tabA I have a field called
nbrBalDue. In the Click event of a button on tabA I have the following code

Me.nbrBalDue.Value = 66

When I click the button evertyhing works as expected. The BalDue field now
has a value of 66.

However, if I put another button on TabB with the same code in it and click
it, BalDue does not get updated to 66.

Could somone explain why?

推荐答案

*" Woody Splawn" < WO *** @ splawns.com> scripsit:
* "Woody Splawn" <wo***@splawns.com> scripsit:
我有一个winform,上面有一个标签。在tabA上我有一个名为
nbrBalDue的字段。在tabA上的按钮的Click事件中,我有以下代码

Me.nbrBalDue.Value = 66
当我点击按钮时,evertyhing按预期工作。 BalDue字段现在的值为66.

但是,如果我在TabB上添加了另一个按钮,其中包含相同的代码并单击
它,BalDue不会更新到66.
I have a winform with a tab on it. On tabA I have a field called
nbrBalDue. In the Click event of a button on tabA I have the following code

Me.nbrBalDue.Value = 66

When I click the button evertyhing works as expected. The BalDue field now
has a value of 66.

However, if I put another button on TabB with the same code in it and click
it, BalDue does not get updated to 66.




这个领域的类型是什么?一个文本框?


-

Herfried K. Wagner

MVP·VB Classic,VB.NET

< http://www.mvps.org/dotnet>


改善报价方式:

< http:// learn。 to / quote>

< http://www.plig.net/nnq/nquote.html>



What''s the type of the field? A textbox?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Improve your quoting style:
<http://learn.to/quote>
<http://www.plig.net/nnq/nquote.html>


其实是Infragistics UltraNumeric编辑。
Actually its an Infragistics UltraNumeric Editor.


Hi Woody,


您可以为多个Button使用相同的处理程序。


Sub Button_Click(...)处理ButtonA.Click,ButtonB.Click

Me.nbrBalDue.Value = 66

MshBox(" nbrBalDue is现在& Me.nbrBalDue.Value.ToString


这样做,看看它是否仍然无法更新。


接下来,你说nbrBalDue在tabA上。单击

tabB上的按钮时,可能隐藏了nbrBalDue。因此,直到你回到tabA,你才能看到它。这表明当你显示Tab时,nbrBalDue将被重置为某个默认值。


问候,

Fergus
Hi Woody,

You can use the same handler for more than one Button.

Sub Button_Click (...) Handles ButtonA.Click, ButtonB.Click
Me.nbrBalDue.Value = 66
MshBox ("nbrBalDue is now " & Me.nbrBalDue.Value.ToString)

Have a go that way and see if it still fails to update.

Next, you say that nbrBalDue is on tabA. When you click the Button on
tabB, presumably nbrBalDue is hidden. Therefore you can''t see it until you go
back to tabA. And this suggests that when you show the Tab, nbrBalDue is being
reset to some default value.

Regards,
Fergus


这篇关于为什么这没用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆