Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Disable Certain Tabs from TabControl

Before people tell me to go to google, I have already searched a few pages from google in regards to my question.

This isn't a case of "TabPage1.Enabled = False" as that only disables the contents in the page.

Basically, I am creating a Password Management program for personal use, and I have the TabControl created by Mavamartin (if that is how his name is spelt) basically, this is what it looks like;

i.imgur [.] com/N4VxfRW.png

And I am wanting to disable the tabs in-between Settings & About.

As you can see I have a blank tab selected, but want to disable 5,6,7,8(which is in between the two).

I have tried;

Code
For Each tab In DotNetBarTabcontrol1.TabPages
        If tab.Text =""
            tab.Enabled =False
        End If
    Next
,

And quiet a few other methods I saw online but none are working.

If someone know's how this could be possible (IF) would you mind giving a hand?

Thanks.

(Sorry for image link, I have below 50 post's)
Maybe remove will be the best option.
[Image: narwinsig.gif]
You may want to look at the Selecting event for that:

PHP Code

<?php 
Private Sub TabControl1_Selecting(sender as Object, e as TabControlCancelEventArgs) Handles TabControl1.Selecting
    
If TabControl1.SelectedTab Is Settings Then
       
' Cancel Selection (tab cannot be selected)
       e.Handled = True
    End If
End Sub 
Don't individual tabs have a Visible property or am I just making this up?
(Feb 6, 2017 10:20 AM)Ninja Wrote:  Don't individual tabs have a Visible property or am I just making this up?

Being a custom tab control this one doesn't have a visible property.


(Feb 6, 2017 10:05 AM)Naywyn Wrote:  You may want to look at the Selecting event for that:

PHP Code

<?php 
Private Sub TabControl1_Selecting(sender as Object, e as TabControlCancelEventArgs) Handles TabControl1.Selecting
    
If TabControl1.SelectedTab Is Settings Then
       
' Cancel Selection (tab cannot be selected)
       e.Handled = True
    End If
End Sub 

Will give it a shot mate, and post back. Thank you for your help. :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by SIM-3933056Apr 16, 2021 02:08 PM 29 1,217 Apr 16, 2021 02:08 PM
Last Post: centan
[.NET] by sgamesOct 15, 2018 10:19 AM 5 348 Oct 15, 2018 10:19 AM
Last Post: sgames
[.NET] by edin_Jan 25, 2018 11:55 AM 4 303 Jan 25, 2018 11:55 AM
Last Post: Ninja