2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by sknake
0

No .. disabling a parent container will disable its child controls as well. Are you trying to stop a user from changing tabs but let them be able to work with the current tab? If so you can do this:

Public Class frmTab
	Private _locked As Boolean = False

	Private Sub ButtonLockTab_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLockTab.Click
		LockTab(True)
	End Sub

	Private Sub ButtonUnlockTab_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonUnlockTab.Click
		LockTab(False)
	End Sub

	Private Sub LockTab(ByVal Lock As Boolean)
		_locked = Lock
	End Sub

	Private Sub TabControl1_Selecting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TabControlCancelEventArgs) Handles TabControl1.Selecting
		If (_locked) Then
			e.Cancel = True
		End If
	End Sub
End Class
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.