Search:
Namespaces
Discussions
.NET v1.1
Feedback
tab control
Messages
Related Types
This message was discovered on
ASPFriends.com 'winforms-cs' list
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
dave wanta (VIP)
hi all,
I have a tab control on a winform. How do you programmatically switch between tabs?
If I do something like
tabPage1.BringToFront();
tabPage1.Focus();
tabPage1.Show();
The contents of the tab will show, but the tabstrip itself doesn't switch to the correct tab. What is the correct method to switch between tabs?
Thanks,.
dave
Reply to this message...
Ryan Trudelle-Schwarz
You try this method:
tabControl.SelectedTab =3D tabPage1
>From the docs:
ms-help://MS.NETFrameworkSDK/cpref/html/frlrfsystemwindowsformstabcontrol=
classselectedtabtopic.htm
-----Original Message-----
From: dave wanta [mailto:
Click here to reveal e-mail address
]=20
hi all,
I have a tab control on a winform. How do you programmatically switch =
between tabs?
=20
If I do something like
=20
tabPage1.BringToFront();
tabPage1.Focus();
tabPage1.Show();
=20
The contents of the tab will show, but the tabstrip itself doesn't =
switch to the correct tab. What is the correct method to switch between =
tabs?
=20
Thanks,.
dave
---
[This E-mail scanned for viruses by Declude Virus]
Reply to this message...
Marisk
Anyone have a clue as to how to programmaticaly set the tabpage of a tab control ??
The
TabControl
.Select,
TabControl
.SelectNextControl,
TabControl
.SelectedIndex,
TabControl
.SelectedTab methods and settings do not have any effect.
Are there config settings that need to be applied ?
Reply to this message...
Scott Berry
This is a multi-part message in MIME format.
--------------InterScan_NT_MIME_Boundary
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C20CBA.681E4D40"
------_=_NextPart_001_01C20CBA.681E4D40
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
SelectedIndex and SelectedTab properties should work. Either of these
two lines works for me, and they do the same thing (select the second
TabPage
(because it's 0-indexed) of the 2 TabPages I have):
=20
tabControl1.SelectedIndex =3D 1;
tabControl1.SelectedTab =3D tabControl1.TabPages[1];
-Scott
=20
This posting is provided "AS IS" with no warranties, and confers no
rights.
=20
-----Original Message-----
From: Marisk [mailto:
Click here to reveal e-mail address
]=20
Sent: Thursday, May 30, 2002 12:17 PM
To: winforms-cs
Subject: [winforms-cs] Tab Control
=20
Anyone have a clue as to how to programmaticaly set the tabpage of a tab
control ??
=20
The
TabControl
.Select,
TabControl
.SelectNextControl,
TabControl
.SelectedIndex,
TabControl
.SelectedTab methods and settings do
not have any effect. =20
=20
Are there config settings that need to be applied ?
=20
=20
| [winforms-cs] member
Click here to reveal e-mail address
=3D YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
=3D JOIN/QUIT=20
------_=_NextPart_001_01C20CBA.681E4D40
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:PMingLiU;
panose-1:2 2 3 0 0 0 0 0 0 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"\@PMingLiU";
panose-1:2 2 3 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:Arial;
color:teal;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body bgcolor=3Dwhite lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 color=3Dteal face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:teal'>SelectedIndex and SelectedTab =
properties
should work. Either of these two lines works for me, and they do =
the same
thing (select the second
TabPage
(because it’s 0-indexed) of the 2 =
TabPages
I have):</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dteal face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:teal'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> &=
nbsp; tabControl1.SelectedIndex
=3D 1;</span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> &=
nbsp; tabControl1.SelectedTab
=3D tabControl1.TabPages[1];</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dteal face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:teal'> =
-Scott</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dteal face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:teal'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>This posting is provided "AS IS" =
with no
warranties, and confers no rights.</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dteal face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:teal'> </span></font></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original =
Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> Marisk
[mailto:
Click here to reveal e-mail address
] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Thursday, May 30, =
2002 12:17
PM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> winforms-cs<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> [winforms-cs] =
Tab Control</span></font></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'> </span></font></p>
<div>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Anyone have a clue as to =
how to
programmaticaly set the tabpage of a tab control ??</span></font></p>
</div>
<div>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'> </span></font></p>
</div>
<div>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>The
TabControl
.Select, TabControl.SelectNextControl, =
TabControl
.SelectedIndex,
TabControl
.SelectedTab methods and settings do not have any =
effect. </span></font></p>
</div>
<div>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'> </span></font></p>
</div>
<div>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Are there config settings =
that need
to be applied ?</span></font></p>
</div>
<div>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'> </span></font></p>
</div>
<div>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'> </span></font></p>
</div>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>| [winforms-cs] member
Click here to reveal e-mail address
=
=3D YOUR
ID |
http://www.asplists.com/asplists/winforms-cs.asp
=3D JOIN/QUIT =
</span></font></p>
</div>
</body>
</html>
=00
------_=_NextPart_001_01C20CBA.681E4D40--
--------------InterScan_NT_MIME_Boundary--
Reply to this message...
System.Windows.Forms.TabControl
System.Windows.Forms.TabPage
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com