C# winform form control tabControl and flowLayoutPanel

C# winform form control tabControl and flowLayoutPanel

I used two controls tabControl and flowLayoutPanel when making winform forms before, and summarized a little content as follows:
Insert picture description hereThis is the tabControl control I made. It looks a bit ugly, the font is not centered, and the tabs are all to the left, so how about Let the font play in it? I have summarized two methods: The
first method is: right-click the control and select properties, find Padding, modify the X will change the length of the tab title (as shown in Figure 1), modify Y will change the title of the selection card Height (as shown in Figure 2). But the font is not centered yet. At this time, you can right-click on each tab and select properties, find Text, hit the space bar in front of the text you enter, and adjust the in-play. This method is relatively troublesome.
Figure 1 (After the X value is changed to 25)

Figure 2 (After the Y value is changed to 15)

Insert picture description here
The second method: Right-click the control and select properties, find SizeMode, and select Fixed to change the tab width and font centering. This method is more convenient than the first method, and the two methods can also be used in combination.
In short, you can achieve the desired effect.
Insert picture description here
Note: It is this control that needs to be right-clicked, not each tab. Right-click on the position of the mouse.

Then I added a lot of Button buttons to the tabs of the tabControl control, and then ordered them to be sequenced. When I run the display, it is normal, and when I maximize the window, the following picture appears.
Insert picture description here
So how can these buttons be sequenced after the window is maximized? This is the flowLayoutPanel container.
When I add the flowLayoutPanel to each tab, let it Dock, and then add the buttons one by one to the flowLayoutPanel to make it sequenced, and then run, maximize the window to achieve the effect shown in the figure below.
Insert picture description hereHere I deliberately checked the flowLayoutPanel control. It belongs to a container and you can add controls inside. The added controls are arranged along the horizontal or vertical flow direction, which can be changed from one row to the next row, or from one column to the next. a row. Or, you can tailor its content instead of wrapping it.

Guess you like

Origin blog.csdn.net/Kevin_Sun777/article/details/107965407