473,791 Members | 3,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

vavc1980
25 New Member
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 2491
Frinavale
9,735 Recognized Expert Moderator Expert
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 Recognized Expert Contributor
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 InitializeCompo nent 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 Recognized Expert Moderator Expert
Hey,

Is there any major difference when doing this? I always believed that controls were created when the InitializeCompo nent 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
12069
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 there a way to clone ( copy the structure) a tabpage to create anew one by code? thanks.
1
2740
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 TabControl.TabPages.Add(MyTabPage), a new BLANK tabpage is added. How can I add in few statements a new tabpage as well as its controls (textboxes, labels, etc.)? The first tabpage (that I create at design time) is the "template" to be used for the other tabpages. Is...
11
2144
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 Headers to be visible for both of them .. at all times... How do I accomplish this? Also can One Tab control have Tab Headers on Top and Side.. at the same time?..That might solve this problem easily :-) Thanks Vijay
9
2790
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 a similar thing with macros. Details: I have a c project to fit into a small microprocessor and need to save some ram. I have a significant number of flags all over the place that currently use whole byte storage. I thought if I had a way to...
0
2700
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 bankaccountnummber, so that no invalid date or bankaccountnumber can be inputted. I started out with the tabcontrol of infragistics. But I also want to use the atlas update panel, and this gives conflicts when used together with the infragistics...
2
1626
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 Long 'used for doing nothing For Each ctr As Control In frm.Controls If TypeOf ctr Is ComboBox Then ctr.Enabled = False ElseIf TypeOf ctr Is DateTimePicker Then
8
3590
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 picture box, lots of text boxes (for input).. you get the idea. All of a sudden everything on the form has disappeared, it looks like a blank, newly created form. I can still get to the properties of every item on the form using the drop-down box in...
6
12935
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 TabPage that wad made during the design time together with all its controls, but without the controls data. Is there an easy way to do that?
2
2295
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(); Crownwood.Magic.Controls.TabPage tb1 = new Crownwood.Magic.Controls.TabPage("Document1", rch); but i can't access the richtextbox control property like rch.load();
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10419
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10201
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9987
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6770
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5424
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.