Tab Control
11K views
Nov 7, 2023
Tab Control
View Video Transcript
0:00
in this video we are going to see how to use a tab control in a windows forms
0:06
application a tab control is usually a combination of bunch of tab pages and
0:12
each tab page can host different user interfaces so to understand a tab
0:18
control better let's drag and drop a tab control from your toolbox to the onto
0:26
the forms here is a tab control you drag and drop onto a form as you can see by
0:32
default a tab control is created with two pages that one page one tap page two
0:41
before anything else what I'm going to do is I'm going to dock this to fill so
0:49
it fills my whole form right here now if you click on this little handle you'll
0:56
see add tab remove tab so I can actually add one more tab here as you can tap it
1:01
so you add one more tab here so I have now four tab pages now purpose of these tab pages is say for example if you want to have a different page for different kind of functionality you can put all those controls on one tab
1:19
If you have a different functionality you can put on tab page 2 and 3 and so on
1:24
So let's create bunch of controls on tab page 1 say Now you can add any controls you want
1:54
I'm just putting few controls to just show you how it works you know now one
2:02
thing you want to know is if you click on these tab pages you still see in
2:07
properties tab control so if you want to change these tab pages properties by
2:13
separately what you do to do is in properties you go and select tab page 1 as soon as you select tab page 1 now I can set properties of this tab page one right here so I can say background color I can
2:28
change border style background color let's say change to yellow as you can see
2:34
background of this tab page one is changed to yellow and I can say border
2:38
style to say fix single and I can actually set other properties I'll say
2:46
this say 12 okay all right so this font is not supported so what we can do is
2:54
pick something else that sounds good there you go so now before we go back
3:05
just quickly let's go and run this sample hit F5 as soon as you hit F5 you
3:11
will see your form looks like this and you'll see tab page 1, tab page 2, tab page 3 and
3:17
if you click on these you will see different controls on different tab pages
3:22
So that's major function of a tab control. Now besides that what you want is say if you want to have a click button control click button event handler You just use all these controls are handled separately
3:40
So there is no other functionality you want to do. This is just basic functionality
3:47
Now let's go back to our tab control. Now say you want to add there is a tabs property actually
3:57
pages property what this does this represent all of these tab pages so you know how we saw add and
4:04
remove tab pages if you click on this this launches the tab page collection editor here what you can
4:11
do is you can add remove and set properties of your tab pages again so this is another way you
4:17
can add and remove so properties and functionality of tab pages and dynamically you can also access
4:25
all tab pages using the tab pages property. So this was a quick introduction of how to use a tab page in a Windows Phone's application
4:37
In my next series I'm going to delve into more details of tab pages
#Software