473,498 Members | 37 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting the reference to the control add to a TabControl

I created a tabcontrol toolin my application.(actually i am creating a
tabbed browser)

when the user clicks on the newtab button(provided by me) the new tab
is added and the webbrowser control is added to that by the following
code.

TabPage t = new TabPage();
t.Text = "tabpage" + i.ToString();
tabControl1.TabPages.Add(t);
WebBrowser w = new WebBrowser();
t.Controls.Add(w);
w.Dock = DockStyle.Fill;

now depeding the current tab selected i want the reference to the
tabpage and the webbrowser control added to that.

index1 = tabControl1.TabIndex;
t1 = tabControl1.TabPages[index1];
now how can get reference to the webcontrol added to t1;

i need the code for this : w1=[the reference to the
webcontrol in t1]
---Sravan

Jun 14 '07 #1
1 1722
On 14 jun, 10:23, sravan_reddy001 <sravanganta2...@gmail.comwrote:
I created a tabcontrol toolin my application.(actually i am creating a
tabbed browser)

when the user clicks on the newtab button(provided by me) the new tab
is added and the webbrowser control is added to that by the following
code.

TabPage t = new TabPage();
t.Text = "tabpage" + i.ToString();
tabControl1.TabPages.Add(t);
WebBrowser w = new WebBrowser();
t.Controls.Add(w);
w.Dock = DockStyle.Fill;

now depeding the current tab selected i want the reference to the
tabpage and the webbrowser control added to that.

index1 = tabControl1.TabIndex;
t1 = tabControl1.TabPages[index1];
now how can get reference to the webcontrol added to t1;

i need the code for this : w1=[the reference to the
webcontrol in t1]

---Sravan

Hi,

You see the tabindex is about the tab order to switch between control
using the tab key, so you must use something like selectedindex or use
the selectedtab (i dont remember the property name but is something
like that) to get the selection then use controls[0] and you will get
your browser

cheers

Jun 14 '07 #2

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

Similar topics

3
14003
by: ColinC | last post by:
Hi, as a newbie to Visual Studio C# Forms development, I'd like some advice on the following. I have a form with a tab control. I have some tab titles that are three words e.g "house &...
7
6234
by: Mark Denardo | last post by:
Hi I have a TabControl object that I need to insert new TabPages into. To append them to the end of the Controls Collection I can do: tc.controls.add(tp) (tc - tabcontrol object) (tp -...
10
12026
by: mikl | last post by:
How do you change the overall background color for a tab control (not on each individual tab). I tried Tabcontrol1.Backcolor = System.Drawing.Color.Blue but this did not work. Thanks mikl
3
1558
by: meh | last post by:
Hi All; After creating a new tab if I delete the tab I cannot close my app from the X in the upper right of the window. NE1 have a clue why. Tried stepping through the delete seems to work fine...
1
8578
by: Flack | last post by:
Hey guys, Here is whats happening. I have a StringBuilder, a TextBox, and a TabControl with one TabPage. On my main form, I created and displayed a fairly big maze. While the app is solving...
3
1801
by: Marc Solé | last post by:
Hello to everybody. I have a little problem with a Custom Control that I have created. The thing is that in my control, when I click a button, it should create another object in the main form. ...
1
2063
by: StyrofoamSUV | last post by:
Hello all. I am interested in hiding a ListView Control underneath a TabControl. The ListView Control will contain say, 5 columns. When the user selects 1 of the tabs, I want to show the ListView...
17
7362
by: Kbalz | last post by:
I'm developing a Wizard type program, and I'm flipping between steps by using a TabControl.. buttons on each tabPage move to the next or previous tabPage. When I press CTRL+Tab however, the...
2
2234
by: sravan_reddy001 | last post by:
I created a tabcontrol toolin my application.(actually i am creating a tabbed browser) when the user clicks on the newtab button(provided by me) the new tab is added and the webbrowser control...
2
1758
by: naamala | last post by:
Hi, I need to change individual tab's background color in TabControl in windows form. I am able to change the Backgrond color of each tab in TabControl with changing the property...
0
7124
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
6998
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
7163
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
7200
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...
1
6884
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
4586
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...
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.