473,395 Members | 1,666 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,395 software developers and data experts.

Tab Control Question

I am using the following code to disable tabs on a tab control:

Private Sub TabC1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TabC1.SelectedIndexChanged

If radFixed.Checked = True And radH.Checked = True And
TabC1.SelectedTab Is tabH Then

TabC1.SelectedTab = tabH

ElseIf radFixed.Checked = True And radHf.Checked = True And
TabC1.SelectedTab Is tabHf Then

TabC1.SelectedTab = tabHf

ElseIf radFixed.Checked = True And radVcw.Checked = True And
TabC1.SelectedTab Is tabVcw Then

TabC1.SelectedTab = tabVcw

ElseIf radFixed.Checked = True And radVccw.Checked = True And
TabC1.SelectedTab Is tabVccw Then

TabC1.SelectedTab = tabVccw

ElseIf radRotating.Checked = True And TabC1.SelectedTab Is tabR Then

TabC1.SelectedTab = tabR

Else

TabC1.SelectedTab = tabMain

End If

End Sub

The problem is the "Else" statement. If the user is on a tab (where he
should be) and selects another tab, it is disabled like I want, however, the
"Else" statement sends hime back to the main tab. Is their a property to
tell what tab I am currently on and just stay there. Something like tab =
tabcontrol.currenttab ?

Thanks,

John
Nov 20 '05 #1
3 1324
Hi,

Here is a tab control that allows you to cancel a tab page change.
http://www.onteorasoftware.com/downl...tabcontrol.zip

Ken
------------------

"jcrouse" <me> wrote in message
news:e$**************@tk2msftngp13.phx.gbl:
I am using the following code to disable tabs on a tab control:

Private Sub TabC1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TabC1.SelectedIndexChanged

If radFixed.Checked = True And radH.Checked = True And
TabC1.SelectedTab Is tabH Then

TabC1.SelectedTab = tabH

ElseIf radFixed.Checked = True And radHf.Checked = True And
TabC1.SelectedTab Is tabHf Then

TabC1.SelectedTab = tabHf

ElseIf radFixed.Checked = True And radVcw.Checked = True And
TabC1.SelectedTab Is tabVcw Then

TabC1.SelectedTab = tabVcw

ElseIf radFixed.Checked = True And radVccw.Checked = True And
TabC1.SelectedTab Is tabVccw Then

TabC1.SelectedTab = tabVccw

ElseIf radRotating.Checked = True And TabC1.SelectedTab Is tabR Then

TabC1.SelectedTab = tabR

Else

TabC1.SelectedTab = tabMain

End If

End Sub

The problem is the "Else" statement. If the user is on a tab (where he
should be) and selects another tab, it is disabled like I want, however,
the
"Else" statement sends hime back to the main tab. Is their a property to

tell what tab I am currently on and just stay there. Something like tab =

tabcontrol.currenttab ?

Thanks,

John


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004
Nov 20 '05 #2
Thanks for the response Ken. I'll take a look see when I get a second. I did
get it working (at least disabling the other tabs, using a variable. Here is
the code:

Private Sub TabC1_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles TabC1.SelectedIndexChanged

If radFixed.Checked = True And radH.Checked = True And
TabC1.SelectedTab Is tabH Then

TabC1.SelectedTab = tabH

curTab = tabH

Exit Sub

ElseIf radFixed.Checked = True And radHf.Checked = True And
TabC1.SelectedTab Is tabHf Then

TabC1.SelectedTab = tabHf

curTab = tabHf

Exit Sub

ElseIf radFixed.Checked = True And radVcw.Checked = True And
TabC1.SelectedTab Is tabVcw Then

TabC1.SelectedTab = tabVcw

curTab = tabVcw

Exit Sub

ElseIf radFixed.Checked = True And radVccw.Checked = True And
TabC1.SelectedTab Is tabVccw Then

TabC1.SelectedTab = tabVccw

curTab = tabVccw

Exit Sub

ElseIf radRotating.Checked = True And TabC1.SelectedTab Is tabR Then

TabC1.SelectedTab = tabR

curTab = tabR

Exit Sub

Else

TabC1.SelectedTab = curTab

Exit Sub

End If

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click

TabC1.SelectedTab = tabMain

End Sub

However, now I can't get back to the "Main" tab. The last sub makes the
entire Options form disappear. Any idea what I'm overlooking here?

Thanks,
John

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

Here is a tab control that allows you to cancel a tab page change.
http://www.onteorasoftware.com/downl...tabcontrol.zip

Ken
------------------

"jcrouse" <me> wrote in message
news:e$**************@tk2msftngp13.phx.gbl:
I am using the following code to disable tabs on a tab control:

Private Sub TabC1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TabC1.SelectedIndexChanged

If radFixed.Checked = True And radH.Checked = True And
TabC1.SelectedTab Is tabH Then

TabC1.SelectedTab = tabH

ElseIf radFixed.Checked = True And radHf.Checked = True And
TabC1.SelectedTab Is tabHf Then

TabC1.SelectedTab = tabHf

ElseIf radFixed.Checked = True And radVcw.Checked = True And
TabC1.SelectedTab Is tabVcw Then

TabC1.SelectedTab = tabVcw

ElseIf radFixed.Checked = True And radVccw.Checked = True And
TabC1.SelectedTab Is tabVccw Then

TabC1.SelectedTab = tabVccw

ElseIf radRotating.Checked = True And TabC1.SelectedTab Is tabR Then

TabC1.SelectedTab = tabR

Else

TabC1.SelectedTab = tabMain

End If

End Sub

The problem is the "Else" statement. If the user is on a tab (where he
should be) and selects another tab, it is disabled like I want, however,
the
"Else" statement sends hime back to the main tab. Is their a property to

tell what tab I am currently on and just stay there. Something like tab =
tabcontrol.currenttab ?

Thanks,

John


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004

Nov 20 '05 #3
Resolved!

Thanks,
John
"jcrouse" <me> wrote in message
news:e$**************@tk2msftngp13.phx.gbl...
I am using the following code to disable tabs on a tab control:

Private Sub TabC1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TabC1.SelectedIndexChanged

If radFixed.Checked = True And radH.Checked = True And
TabC1.SelectedTab Is tabH Then

TabC1.SelectedTab = tabH

ElseIf radFixed.Checked = True And radHf.Checked = True And
TabC1.SelectedTab Is tabHf Then

TabC1.SelectedTab = tabHf

ElseIf radFixed.Checked = True And radVcw.Checked = True And
TabC1.SelectedTab Is tabVcw Then

TabC1.SelectedTab = tabVcw

ElseIf radFixed.Checked = True And radVccw.Checked = True And
TabC1.SelectedTab Is tabVccw Then

TabC1.SelectedTab = tabVccw

ElseIf radRotating.Checked = True And TabC1.SelectedTab Is tabR Then
TabC1.SelectedTab = tabR

Else

TabC1.SelectedTab = tabMain

End If

End Sub

The problem is the "Else" statement. If the user is on a tab (where he
should be) and selects another tab, it is disabled like I want, however, the "Else" statement sends hime back to the main tab. Is their a property to
tell what tab I am currently on and just stay there. Something like tab =
tabcontrol.currenttab ?

Thanks,

John

Nov 20 '05 #4

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

Similar topics

0
by: news.microsoft.com | last post by:
I have a user control with four option buttons depending which option button is pressed I store a score into session object. On the load event of a control the session object is set to 0. There is...
4
by: Marius Trælnes | last post by:
Hello! I am about to make a class/control that creates tabbing functionality. The result is in HTML/CSS/JavaScript output. My question is: Within the tabs I want to simply add user controls...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
5
by: Richard Brown | last post by:
Ok, I've been looking through the .NET SDK docs and stuff. I'm wondering if you can provide a control extender that does generic validation or functionality just by dropping it on the form. For...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
1
by: Mark Olbert | last post by:
I have a "master" composite control which, in turn, holds an instance of a "detail" composite control (the "master" control will ultimately contain multiple instances of the "detail" control, but...
3
by: Hamed | last post by:
Hello Is it possible to get a control (e.g. a checkbox) and make a Graphics object or a Bitmap object of current face of the control? I want to implement Sparse property for a ColumnStyle so I...
15
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
1
by: Alec MacLean | last post by:
Hi, Outline of problem: I've built a set of user controls that are used to output questions for a survey and gather the responses using simple radio buttons. I'm adding an optional textbox...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
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.