Hide Tabpage
-
Dear all, Anyone can hide the tabpages in tabcotrol Don't tell follows Me.TabControl1.TabPages.Item(0).Visible = False This is not working And also can you draw line on tabpages rugfy Ishak
-
Dear all, Anyone can hide the tabpages in tabcotrol Don't tell follows Me.TabControl1.TabPages.Item(0).Visible = False This is not working And also can you draw line on tabpages rugfy Ishak
rugfy wrote: Anyone can hide the tabpages in tabcotrol You cannot hide the page, but you can use the TabPages collection of the Tab Control to remove the page altogether. If you need to be able to add the TabPage back dending on some condition, you can save the TabPage in a Collection before you remove it. Because adding the page back in order is a hassle, the easiest thing to do is when you initialize the form, add all TabPages to the collection in the correct order. Then if you remove a TabPage and need to add it back later, just remove all TabPages and then replace them all in order from the collection. Of course, you will lose any data that has been entered if you use this approach, so you may have to add additional code if you need to maintain the data state... You can draw a line on a TabPage using the Graphics object. However, if you are going to be removing tabpages at run time, the events could get complicated. The easiest way to create a line is to create a Panel on the tab page, set it's BackColor to the color of the line you want, and set it's height to 1 pixel.
-
rugfy wrote: Anyone can hide the tabpages in tabcotrol You cannot hide the page, but you can use the TabPages collection of the Tab Control to remove the page altogether. If you need to be able to add the TabPage back dending on some condition, you can save the TabPage in a Collection before you remove it. Because adding the page back in order is a hassle, the easiest thing to do is when you initialize the form, add all TabPages to the collection in the correct order. Then if you remove a TabPage and need to add it back later, just remove all TabPages and then replace them all in order from the collection. Of course, you will lose any data that has been entered if you use this approach, so you may have to add additional code if you need to maintain the data state... You can draw a line on a TabPage using the Graphics object. However, if you are going to be removing tabpages at run time, the events could get complicated. The easiest way to create a line is to create a Panel on the tab page, set it's BackColor to the color of the line you want, and set it's height to 1 pixel.
Thanx a Lot But I don't need it ,My actual Think is i want to give the distance between two pages like seperator in toolbar for some elegant look.thats all.In this case my doubt is whats the use of Tabcontrol.Tabpages(0).Vaiable = False Does it doing nothing Thats Why Any way Once Thanx For your reply Ishak