C# toolStrip of winform form control

C# toolStrip of winform form control

We may need a toolbar when making a form, then the easiest way is to add a toolStrip control.
Insert picture description here
How to complete a toolbar as shown in the figure above?
First, you need to add a toolStrip control, and then click the Add button on the control to add the control you need. Here we add the Button. After the addition is complete, right-click the toolStrip control and select properties, and change AutoSize to False. At this time, you can change the length and width of the toolStrip at will. After widening the toolStrip control, you will find that the image on the Button is very small. At this time, continue to change the properties of the toolStrip control, find ImageScalingSize, and change the values ​​of Height and Width to make the image larger.

After changing ImageScalingSize before
Insert picture description herechanging ImageScalingSize
Insert picture description here
Next, right-click the added Button and select properties, change AutoSize to False, change the Height and Width values ​​of Size, and add the button icon to Image.
Insert picture description here
If you want to display the icon and text on the Button at the same time, you can continue to change the properties of the Button. Find DisplayStyle in the properties of Button, select ImageAndSize, and then enter text in Text.
However, we will find out why the previously added icon is missing, and only the text just added is displayed.
Insert picture description hereContinue to find TextImageRelation in the properties of Button, select ImageAboveText, so that the icon and text can be displayed at the same time.
Insert picture description here

Guess you like

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