469,299 Members | 2,079 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

Hide TabPage

Hey there!
I have a tabcontrol on one of my forms. Some of the tab should not be
accessable (and thus invisible) until you give the correct password. But I
can't hide the tab...
tabSecrets1.Visible=false
tabSecrets1.Hide
will not work, the tab is visible :(

Any help is appreciated
Kejpa
Nov 21 '05 #1
8 7344
Kejpa,

You can add and remove tappages from the tabcontrol using those methods.

With that you have than directly overcome the strange bug in the tabcontrol.

Cor
Hey there!
I have a tabcontrol on one of my forms. Some of the tab should not be
accessable (and thus invisible) until you give the correct password. But I
can't hide the tab...
tabSecrets1.Visible=false
tabSecrets1.Hide
will not work, the tab is visible :(

Any help is appreciated
Kejpa

Nov 21 '05 #2
Hey Cor,
in my form_load event I set pgSecret1.Visible=false but it's still visible.
If I use pgSecret1.Hide it's also there.

I guess I'm too tired to see what's really simple, so.... Just a small
snippet, plz :)

Regards
Kejpa

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eA**************@tk2msftngp13.phx.gbl...
Kejpa,

You can add and remove tappages from the tabcontrol using those methods.

With that you have than directly overcome the strange bug in the tabcontrol.
Cor
Hey there!
I have a tabcontrol on one of my forms. Some of the tab should not be
accessable (and thus invisible) until you give the correct password. But I can't hide the tab...
tabSecrets1.Visible=false
tabSecrets1.Hide
will not work, the tab is visible :(

Any help is appreciated
Kejpa


Nov 21 '05 #3
On Thu, 21 Oct 2004 15:45:06 +0300, Kejpa wrote:
tabSecrets1.Visible=false
tabSecrets1.Hide


Hide and the Visible property of tab pages does NOT work. It has a bug.
In order to make a tab not appear in the tab control, you must REMOVE it
from the tab control using the Remove method.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #4
Hey there, all of you.
Guess what?
It's not working, at all. The Visible property is there but has no function,
same thing with the Hide method.

In order to hide it you have to set it's parent to Nothing, it reappear when
you set the parent back to the original control, but not in the original
position.

Guess .NET v 1.0 really should have been .NET v 0.1 :(
Things working swell in VB6 should work with the new framework too, IMHO

/Kejpa

"Kejpa" <kS*******@saj.fi> wrote in message
news:cl**********@gandalf.alcom.aland.fi...
Hey Cor,
in my form_load event I set pgSecret1.Visible=false but it's still visible. If I use pgSecret1.Hide it's also there.

I guess I'm too tired to see what's really simple, so.... Just a small
snippet, plz :)

Regards
Kejpa

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eA**************@tk2msftngp13.phx.gbl...
Kejpa,

You can add and remove tappages from the tabcontrol using those methods.

With that you have than directly overcome the strange bug in the tabcontrol.

Cor
Hey there!
I have a tabcontrol on one of my forms. Some of the tab should not be
accessable (and thus invisible) until you give the correct password.
But I can't hide the tab...
tabSecrets1.Visible=false
tabSecrets1.Hide
will not work, the tab is visible :(

Any help is appreciated
Kejpa



Nov 21 '05 #5
"Kejpa" <kS*******@saj.fi> schrieb:
I have a tabcontrol on one of my forms. Some of the tab should not be
accessable (and thus invisible) until you give the correct password. But I
can't hide the tab...
tabSecrets1.Visible=false
tabSecrets1.Hide
will not work, the tab is visible :(


<URL:http://www.dotnetrix.co.uk/tabcontrols.html>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #6
Kepja,

\\\
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.TabControl1.Controls.Remove(Me.TabPage1)
Me.TabControl1.Controls.Remove(Me.TabPage2)
Me.TabControl1.Controls.Remove(Me.TabPage3)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Me.TabControl1.Controls.Add(Me.TabPage1)
Me.TabControl1.Controls.Add(Me.TabPage2)
Me.TabControl1.Controls.Add(Me.TabPage3)
End Sub
///
Like this?

Cor
"Kejpa" <kS*******@saj.fi>
Hey Cor,
in my form_load event I set pgSecret1.Visible=false but it's still
visible.
If I use pgSecret1.Hide it's also there.

I guess I'm too tired to see what's really simple, so.... Just a small
snippet, plz :)

Regards
Kejpa

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eA**************@tk2msftngp13.phx.gbl...
Kejpa,

You can add and remove tappages from the tabcontrol using those methods.

With that you have than directly overcome the strange bug in the

tabcontrol.

Cor
> Hey there!
> I have a tabcontrol on one of my forms. Some of the tab should not be
> accessable (and thus invisible) until you give the correct password.
> But I > can't hide the tab...
> tabSecrets1.Visible=false
> tabSecrets1.Hide
> will not work, the tab is visible :(
>
> Any help is appreciated
> Kejpa
>
>



Nov 21 '05 #7
GK
Try, Me.TabControl1.TabPages.Remove(pgSecret1)
TabPages.Visible or TabPages.Hide does not work.

KC
"Kejpa" <kS*******@saj.fi> wrote in message
news:cl**********@gandalf.alcom.aland.fi...
Hey Cor,
in my form_load event I set pgSecret1.Visible=false but it's still
visible.
If I use pgSecret1.Hide it's also there.

I guess I'm too tired to see what's really simple, so.... Just a small
snippet, plz :)

Regards
Kejpa

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eA**************@tk2msftngp13.phx.gbl...
Kejpa,

You can add and remove tappages from the tabcontrol using those methods.

With that you have than directly overcome the strange bug in the

tabcontrol.

Cor
> Hey there!
> I have a tabcontrol on one of my forms. Some of the tab should not be
> accessable (and thus invisible) until you give the correct password.
> But I > can't hide the tab...
> tabSecrets1.Visible=false
> tabSecrets1.Hide
> will not work, the tab is visible :(
>
> Any help is appreciated
> Kejpa
>
>



Nov 21 '05 #8
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:1g****************************@40tude.net...
Hide and the Visible property of tab pages does NOT work. It has a bug.

According to some MVP it's not a bug it's a feature!
The visible property really works!
You can set the visible property of one page to True and the visible
property of the current page to False and then you will see the other page
without changeing the tabheader! THAT's a feature longed for.... NOT!

The Visible property is inherited from Control and that's why it's there,
it's used internally for the TabControl to know which page to show. What I
can't understand is why they didn't set it to Private/Protected.

And I can't understand why the TabVisible(index) property of the VB6
TabbedDialog didn't make the .NET cut?!?

That's my 2c
Kejpa
Nov 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by TMB333 | last post: by
1 post views Thread by Fei Li | last post: by
2 posts views Thread by MAF | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.