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