By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

Bound textbox not filled if tabPage has not been viewed

P: n/a
Tom
I have a form with a tabControl with 6 tabPages. There are
textBoxes on all the tabPages that are bound to a dataset.
The user can click a modify button, edit whatever
textBoxes they want and then click an OK button. The OK
button handler loops over all the textBoxes on all the
tabPages to validate their contents.
The problem is that the textBoxes on any tabPage which has
not been viewed appear empty to the code. It appears that
VB does not fill in bound textBoxes until the tabPage is
viewed (the tab clicked on by the user). Hence my
validation code thinks these textBoxes .text properties
are null and complains. I have kludged around this by
having the validation code select each tabPage in turn.
This works, but the user sees all the various tabPages
rapidly exposed after they hit the OK button.
Is there a better solution?
Thanks
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Tom,

It appears that
VB does not fill in bound textBoxes until the tabPage is
viewed (the tab clicked on by the user).

Right, do not use the value in the textbox however the underlaying data.

I hope this helps?

Cor
Nov 20 '05 #2

P: n/a
Tom
It confirms what I suspected.
Most, but not all of the textboxes are bound to columns in
a dataset. I presently loop over all the controls as a
convenient way to do the validation. It avoids having a
bit of specific code for each column.
Is there an easy way using only the information from the
textbox object (including the binding information) to get
the value of the underlying data? If so then I could
manage to make this work without a major architectural
change.

thanks
Nov 20 '05 #3

P: n/a
Hi Tom,

Show some code how you fill your textbox (probably bound it), than I try to
tell you how you get your information from the source, mostly that needs
less (more unified) code.

Cor
It confirms what I suspected.
Most, but not all of the textboxes are bound to columns in
a dataset. I presently loop over all the controls as a
convenient way to do the validation. It avoids having a
bit of specific code for each column.
Is there an easy way using only the information from the
textbox object (including the binding information) to get
the value of the underlying data? If so then I could
manage to make this work without a major architectural
change.

thanks

Nov 20 '05 #4

P: n/a
Dear Tom,
Can you solve the problem now ????
I got this same problem also, but I can't seek any solution

From agnes
"Tom" <an*******@discussions.microsoft.com> ???
news:2e*****************************@phx.gbl ???...
I have a form with a tabControl with 6 tabPages. There are
textBoxes on all the tabPages that are bound to a dataset.
The user can click a modify button, edit whatever
textBoxes they want and then click an OK button. The OK
button handler loops over all the textBoxes on all the
tabPages to validate their contents.
The problem is that the textBoxes on any tabPage which has
not been viewed appear empty to the code. It appears that
VB does not fill in bound textBoxes until the tabPage is
viewed (the tab clicked on by the user). Hence my
validation code thinks these textBoxes .text properties
are null and complains. I have kludged around this by
having the validation code select each tabPage in turn.
This works, but the user sees all the various tabPages
rapidly exposed after they hit the OK button.
Is there a better solution?
Thanks

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.