473,396 Members | 1,998 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.

C#-APP: Not able to get values of controls in TabPage

vavc1980
Hello,

I'm working on a windows application with C#, I reorganized a screen using the TabControl with 3 TabPages.

Here's my problem, when I want to do something (printing, reading, etc) with a control in any TabPage that has not been opened (clicked on), I got nothing, the controls at this point have not been created, not until I click (manually or programatically) on the TabPage. Right now I have it working going through all tabpages programatically then back to the one that was open originally, but you can see the tabs changing, and this is kind of annoying.

How can I use the controls in the whole screen without having to open the tabs one by one?.

The controls are data binded by the way.

Hope you can help me with this one.

Thanks.
Oct 21 '08 #1
3 2475
Frinavale
9,735 Expert Mod 8TB
Instead of dragging your controls onto your page, declare them in your C# code.
In your Page Load control make sure you place the controls into the appropriate tabs and also make sure that these controls are properly instantiated.

When you call your print function, use the controls that you've declared in your C# code to create your report (they should already be loaded by this point).

-Frinny
Oct 21 '08 #2
cloud255
427 Expert 256MB
Instead of dragging your controls onto your page, declare them in your C# code.
In your Page Load control make sure you place the controls into the appropriate tabs and also make sure that these controls are properly instantiated.
Hey,

Is there any major difference when doing this? I always believed that controls were created when the InitializeComponent function was called, is this correct?
If so, doesn't that mean that the controls are created before OnLoad?

Sorry if this is crazy talk, but i always thought that it worked like this...
Oct 22 '08 #3
Frinavale
9,735 Expert Mod 8TB
Hey,

Is there any major difference when doing this? I always believed that controls were created when the InitializeComponent function was called, is this correct?
If so, doesn't that mean that the controls are created before OnLoad?

Sorry if this is crazy talk, but i always thought that it worked like this...
You're right cloud.
I only made the suggestion because the OP is having problems with accessing data in their controls.

-Frinny
Oct 22 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: touf | last post by:
Hi, I've a tabcontrol that contains many similar tabpages (exactly the same structure with different information), the tabpages number isn't known in the design time it depends of the data. Is...
1
by: Luc | last post by:
Hi, I have a TabControl and, at runtime, I need to add some tabpages. The problem is that each tabpage is similar to the others and contains several controls. If I do...
11
by: VJ | last post by:
I am looking to have 2 Tab Controls on a Windows Forms.. One with Tabs on Top and another with Tabs on the side... I want them both to occupy the entire area of the form, but I need the Tab...
9
by: userblue | last post by:
Hi Does anyone know if there is a way to define what is effectively a single globally visible, enumerated list whilst actually defining the entries across several different modules? or somehow do...
0
by: veerleverbr | last post by:
Hi, I want to create an asp.net page with a tabpage. On the tabpage I want to use the WebDateChooser and WebDataInput controls of Infragistics. These 2 controls use a mask to enter a date and...
2
by: RichG | last post by:
With the help of Cor Ligthert in a pryor post I was able to make this sub: Public Sub disableControls(ByVal frm As Form) 'this is to create a read only form that has active buttons Dim x As...
8
by: Ryan | last post by:
Ok.. I have a form with lots of stuff on it; a tool strip panel, menu strip, data binding elements (dataset, binding source, table adapter), tab control with 7 tab pages, each page contains a...
6
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello gurus, I want to have a Form with a TabControl, this TabControl will contain TabPage that has controls in it, this TabPage is prepared at design time. I want in runtime to duplicate the...
2
Shinobi
by: Shinobi | last post by:
i have a tabcotrol(dotnetmagic) in c#.net and i am trying to create a tabpage containing a richtextbox which is created at runtime. richtextbox rch=new richtextbox();...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.