473,396 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Tab control problem...

I have tab control with several tab pages. Each tab page contains a few
textboxes filled dynamicly from the code. Everything goes fine, but every
textbox that is located on a tab page that has hot been selected after the
form has been activates has no text! Let me try to describe my problem
further:
TAB CONTROL
PAGE PAGE PAGE PAGE
------------------------------------
TXT1 TXT3 TXT5 TXT7
TXT2 TXT4 TXT6 TXT8
------------------------------------

BUTTON(CLOSE)

On form load goes:
TXT1.Text = "my";
TXT2.Text = "form";
TXT3.Text = "isnt";
TXT4.Text = "working";
TXT5.Text = "right";
//etc...
By default, when form openes, the first tab page is focused, and other have
never been focused. When I close this dialog, and set a breakpoint, i get
this odd results:

Button_Close_Click (...)
{
Debug.WriteLine (TXT1.Text);
Debug.WriteLine (TXT1.Text);
}
Nov 17 '05 #1
4 2494
Sorry, last post was somehow ruined, and posted unfinished... here's the
whole post:
------------------------

I have tab control with several tab pages. Each tab page contains a few
textboxes filled dynamicly from the code. Everything goes fine, but every
textbox that is located on a tab page that has hot been selected after the
form has been activates has no text! Let me try to describe my problem
further:
TAB CONTROL
PAGE PAGE PAGE PAGE
------------------------------------
TXT1 TXT3 TXT5 TXT7
TXT2 TXT4 TXT6 TXT8
------------------------------------

BUTTON(CLOSE)

On form load goes:
TXT1.Text = "my";
TXT2.Text = "form";
TXT3.Text = "isnt";
TXT4.Text = "working";
TXT5.Text = "right";
//etc...
Exactly, textboxes are binded to a strong-typed dataset, but that isnt a
problem...
By default, when form openes, the first tab page is focused, and other have
never been focused. When I close this dialog, and set a breakpoint, i get
this odd results:

Button_Close_Click (...)
{
Debug.WriteLine (TXT1.Text); // writes "my" - ok.
Debug.WriteLine (TXT2.Text); // writes "form" - ok
Debug.WriteLine (TXT3.Text); // writes "" - ????
Debug.WriteLine (TXT4.Text); // writes "" - ????
Debug.WriteLine (TXT5.Text); // writes "" - ????
Debug.WriteLine (TXT6.Text); // writes "" - ????
// every control that has been on some tab
// page that was never focused, has no text set!
// WHY?!
}

Sorry for my bad english, i hope you understood me!
Thank you for replies!
Nov 17 '05 #2
Have you tried setting the bindingcontext of each tabpage at form load.

\\\
foreach(TabPage tp in this.tabControl1.TabPages)
{
tp.BindingContext = this.BindingContext;
}
///

This problem only occurs on DataBound controls and is not specific to
TabControls. You will see this behaviour on any control whose visibility
changes (when a tabpage is not selected it is not visible).

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Jeti [work]" <je**@programeri.org> wrote in message
news:eP**************@TK2MSFTNGP14.phx.gbl...
Sorry, last post was somehow ruined, and posted unfinished... here's the
whole post:
------------------------

I have tab control with several tab pages. Each tab page contains a few
textboxes filled dynamicly from the code. Everything goes fine, but every
textbox that is located on a tab page that has hot been selected after the
form has been activates has no text! Let me try to describe my problem
further:
TAB CONTROL
PAGE PAGE PAGE PAGE
------------------------------------
TXT1 TXT3 TXT5 TXT7
TXT2 TXT4 TXT6 TXT8
------------------------------------

BUTTON(CLOSE)

On form load goes:
TXT1.Text = "my";
TXT2.Text = "form";
TXT3.Text = "isnt";
TXT4.Text = "working";
TXT5.Text = "right";
//etc...
Exactly, textboxes are binded to a strong-typed dataset, but that isnt a
problem...
By default, when form openes, the first tab page is focused, and other
have
never been focused. When I close this dialog, and set a breakpoint, i get
this odd results:

Button_Close_Click (...)
{
Debug.WriteLine (TXT1.Text); // writes "my" - ok.
Debug.WriteLine (TXT2.Text); // writes "form" - ok
Debug.WriteLine (TXT3.Text); // writes "" - ????
Debug.WriteLine (TXT4.Text); // writes "" - ????
Debug.WriteLine (TXT5.Text); // writes "" - ????
Debug.WriteLine (TXT6.Text); // writes "" - ????
// every control that has been on some tab
// page that was never focused, has no text set!
// WHY?!
}

Sorry for my bad english, i hope you understood me!
Thank you for replies!

Nov 17 '05 #3
> Have you tried setting the bindingcontext of each tabpage at form load.

\\\
foreach(TabPage tp in this.tabControl1.TabPages)
{
tp.BindingContext = this.BindingContext;
}
///

This problem only occurs on DataBound controls and is not specific to
TabControls. You will see this behaviour on any control whose visibility
changes (when a tabpage is not selected it is not visible).


I've just tried this, and it does not help... Anyway, thank you for the
reply...
Anyone else has any solutions?
Nov 17 '05 #4
I don't really use databinding so I've never had the need to analyze it, but
I did follow the instructions in Q327896 to reproduce the bug with a
CheckedListBox on a TabPage.
http://support.microsoft.com/d*efaul...;en-us;3278*96

The solution I offered did resolve this issue, so I thought it was worth a
mention, but maybe the article will help.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Jeti [work]" <je**@programeri.org> wrote in message
news:eg*************@TK2MSFTNGP15.phx.gbl...
Have you tried setting the bindingcontext of each tabpage at form load.

\\\
foreach(TabPage tp in this.tabControl1.TabPages)
{
tp.BindingContext = this.BindingContext;
}
///

This problem only occurs on DataBound controls and is not specific to
TabControls. You will see this behaviour on any control whose visibility
changes (when a tabpage is not selected it is not visible).


I've just tried this, and it does not help... Anyway, thank you for the
reply...
Anyone else has any solutions?

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Sagaert Johan | last post by:
I have made a custom control that draws a rectangle when the mouse is down, and does nothing when the mouse is up. I set/reset a flag in MouseDown/Mouse up and use this to do the drawing in the...
11
by: Brian W | last post by:
Yet another editor problem To reproduce do the following 1) Open a Webform and switch to HTML edit mode 2) Enter the Following (include spaces) This is some text before <asp:hyperlink...
3
by: Eric | last post by:
I have built a composite user web control that I want to create dynamically. The form will contain a variable number of these controls and as well some of the contents of the user web control...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
7
by: Chuck Hartman | last post by:
I have a Windows service that requests web pages from a site using an HttpWebRequest object. When I try to request a page from an ASP.NET 2 site, I get a WebException with message "The remote...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
4
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
5
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.