Why this no work?

  • Thread starter Thread starter Woody Splawn
  • Start date Start date
W

Woody Splawn

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 said:
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.

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>
 
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
 
Hi Woody,

This might be bad news. Touf has been having a very similar problem
whereby CheckBoxes on a TabPage are being reset.

|| I've a Tabcontrol with many tabpages, in each one I've a
|| checked listBox. The problem is that when I check items
|| in listBox and go to an other page I lost the check (when
|| I return to my tabbpage I find all items Unchecked)

He uses VS 2002, .NET 1.0. Which version are you using?

I can't test this as I have v2002 as well. It might be useful to post
something that those with v2003 can test with.

Regards,
Fergus
 
Hi Woody,

What is the Infragistics UltraNumeric Editor?
Did the problem persists with other control in VS.NET, e.g. textBox?
I look forward to hearing from you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
* "Woody Splawn said:
Actually its an Infragistics UltraNumeric Editor.

Maybe Infragistics provides a support database or their own
forums/newsgroups. Does the problem even occur with other controls?
 
Which version are you using?

I am using version 2003

I have experienced similar problems. But only on fields that are bound.
Are his fields bound?

That is, I have a Winform with tabs on it. In TabA I have two fields. When
the user enters data in field A, a calculation is run to put data in field
B. This code is run from the Validating event of field A. If I move from
field A by tabbing or clicking on another field on the same tab, no problem.
However, if I enter data in field A and then click on Tab B and then return
to Tab A, the value in field B of Tab A is not updated.

This only happens when fields are bound. I can do the same thing with
unbound fields and there is no problem.
 
Hey Peter!
What is the Infragistics UltraNumeric Editor?

It is the Numeric Editor object provided by Infragistics Software. They are
the leader in 3rd party software for VS I believe.
Did the problem persists with other control in VS.NET, e.g. textBox?

Yes. When I use a regular microsoft text box I have the same problem. It
should be noted however that the problem only exists when the the field is
bound. When the fields are unbound there is no problem. When unbound, both
the Infragistics and Microsoft components work. In my case I have the field
bound to a column in a SQL Server table.

What do you think is happening?
 
Thanks for responding Herfried.
Does the problem even occur with other controls?

Yes, please see my response to Peter.
Maybe Infragistics provides a support database or their own
forums/newsgroups

They do but this is one of the classic problems with Visual Studio. I am
glad to be using the product and am not bashing it but from the developers
point of view my frustration is as follows.

MS does not provide tools for the IDE that are sufficient for this
developer. Even the simplest things can not be done without making a
federal case out of it. I feel I have no choice but to turn to third party
products. Infragistics seems to be about the best, at least to me.
However, when you (the developer) have problems, it allows MS to point the
finger at Infragistics and Infragistics to point the finger at MS.
Frustrating. Not possible to get an answer from a singel source. Oh well.
Just part of the day and age I guess.

To me it's all about "Big Ships and Tugboats". Microsoft is a big ship and
has their eye on the sea. It leaves the little things, like the IDE, to the
tugboats. But to the developer, both are important. The ship can't sail
till you get it out of the dock.

Additionally, since I'm on my high soapbox <g>.

Microsoft could benefit tremendously from the PowerBuilder concept of a
DataWindow. It is a patended product so this is not likely. I see so many
circumstances in VS where you have to do things in a non uniform way. For
example, the way you deal with validation with regard to fields on a winform
is completely different than how you do it if you are working with a grid.
The grid method is much simpler since it deal with each entity (each field)
as part of a whole. However, the bottom line on it all is that Microsoft
has the market share and so there's nothing to talk about. I'll eat my
Visual Studio wheaties and like it too. Never the less, these are my
feelings.

Soapbox dismantled.
 
* "Woody Splawn said:
Thanks for responding Herfried.


Yes, please see my response to Peter.
OK.


They do but this is one of the classic problems with Visual Studio. I am
glad to be using the product and am not bashing it but from the developers
point of view my frustration is as follows.

IMO VS.NET and the .NET framework are still in an "early state of
development". Even .NET 2.0 will only be a small step. The big changes
will be done in the framework for Longhorn (VS.NET Orcas I think).
Nevertheless there will be some improvements in the next version:

<http://msdn.microsoft.com/vbasic/whidbey/>

Whidbey will also come with some new controls. In Whidbey data access
will be much easier, have a look at the video linked on the VB.NET
Whidbey information page above.
 
Thanks for the pointer to WhidBey. Verry interesting. This is why I am on
the MS bandwagon. This is where all the action is.

With regard to the original question. Do you have any idea why things are
not working?
 
* "Woody Splawn said:
Thanks for the pointer to WhidBey. Verry interesting. This is why I am on
the MS bandwagon. This is where all the action is.

With regard to the original question. Do you have any idea why things are
not working?

I don't know it but IMHO most of the controls won't be used any more when
Longhorn is released. I seems that this is the reason why the controls
are "buggy" sometimes...

;-)
 
Woody Splawn said:
Thanks for the pointer to WhidBey. Verry interesting. This is why I am on
the MS bandwagon. This is where all the action is.

With regard to the original question. Do you have any idea why things are
not working?

Woody: Is there a chance it is working as "defined" ? I find it unlikely
that this would be completely broken right out of the box without a bunch of
people knowing about it. I also think it is practical to "wait" until some
unspecified time when another version is released... particularly if the new
version operates the same way because "that's what it does."

I don't know that I can be of a lot of help but can you narrow it down to
some code that illustrates the problem? Can you do this without using
Infragistics controls so that we could observe it happening?

Try to elminate the "second tab" and just add a second button to the first
tab, in other words trim out whatever you can while still generating the
behavior you've mentioned. The more things you add the more obscure the
cause is likely to become.

Tom
 
Herfried,
I don't know it but IMHO most of the controls won't be used any more when
Longhorn is released. I seems that this is the reason why the controls
are "buggy" sometimes...

???

Cor
 
* "Cor said:

Windows forms will be "replaced" (even if they don't use this term)...
Have a look at the links Thomas Scheidegger [MVP] posted some days ago
(an "ANN" message).
 
Herfried,

I dont find the vs version 1.1 or the vs.studio 2003 buggy,
we see seldom really bugs here.

I can remember me this last month only one in a Zip file.
But that one you never saw, so you did not even seen that one.

:-))))))))))))))))))))))

Cor
 
Cor said:
I dont find the vs version 1.1 or the vs.studio 2003 buggy,
we see seldom really bugs here.

Absolutely... and besides anything "new" is likely to have new bugs. There
is no "fewer bugs" release being planned. If MS knew there was a bug and it
was easy to fix my guess is it wouldn't be a bug.
 
Fergus,

I've tried your suggestion but it doesn't work for me.

That is, I have a form with two buttons on it. In button1 I have this code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

MsgBox("Button1 has been fired")

End Sub



In button2 I have this:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click, Button1.Click

End Sub



When I click on Button2 nothing happens.
 
* "Cor said:
I dont find the vs version 1.1 or the vs.studio 2003 buggy,
we see seldom really bugs here.

I can remember me this last month only one in a Zip file.
But that one you never saw, so you did not even seen that one.

Seems that you are not hanging around in the Windows Forms groups.
VS.NET isn't buggy, some Windows Forms controls are/were a little bit
buggy.

;-)
 
Back
Top