Saturday, January 5, 2008

Best Sheer Foundation?

Hiding in TabPage Images

Hello

Starting the new year with some simple but useful code ...

As TabControl will see the WinForm has a collection of TabPage controls, the issue is that TabPage controls, who knows why they do not have the Visible property so they can not hide directly and must resort to a little trick I tell them then

Let

following:

1. Place a TabControl with 2 TabPages in a winform

2.Place a checkBox

in winform

3.Click 2 clicks on the checkbox to go to the code and there Propramme the delegate for the event chechkedChanged, that reads:

Private Sub CheckBox1_CheckedChanged ( ByVal sender As System.Object, ByVal and As System.EventArgs) Handles CheckBox1.CheckedChanged
If

I . CheckBox1.Checked Then
Me . TabControl1.TabPages.Remove ( Me . TabPage2)
Else
& # 160;
Me . TabControl1.TabPages.Add ( Me . TabPage2)
End If

End Sub

4. Executives la aplicaciĆ³ny vacationers al mark the second tab chekBox disappears and reappears uncheck

well, that's all they have a happy and prosperous New Year

Salu2


Sergio

0 comments:

Post a Comment