1. Form and interface design-toolbar Design

Source: Internet
Author: User

In the menu bar, common menu commands are displayed as toolbar buttons and used as quick access methods. The toolbar is located at the bottom of the menu bar and consists of multiple command buttons. Each command button has a small icon to identify the function of the command button. This intuitive and easy-to-use tool bar makes it an indispensable element in the Windows application standard interface.

007 toolbar with background

The background in the toolbar is an image. You should draw the image on the toolbar during runtime. In. NET4.0, you only need to set the BackGroundImage attribute of the toolbar button to the corresponding image.

 

1. Create a project. The default form is Form1. Add the ToolStrip control to the Form1 form and add corresponding buttons to the toolbar.

2. Set the corresponding Image attribute for the buttons in the toolbar, and the corresponding Image will become the background of the button.

Whether the form is to be hidden, it is important to determine whether the form has focus through the Focused attribute of the form in the operation. When the form has focus, the form is being operated and must be fully displayed on the screen. When the form has no focus, you can set the height of the form to the screen to determine the hidden part of the form.

1. Create a project. The default form is Form1. Add the Panel control to the Form1 form and add the corresponding background image to the Panel control.

2. add two Label controls on the Panel control, set the Text attribute to "Search" and "close", and set the background color of the two Label controls to transparent, add a timer.

Namespace _ 008_DriftForm {public partial class Form1: Form {public Form1 () {InitializeComponent ();} private void Form1_Load (object sender, EventArgs e) {// this} private void timereffectick (object sender, EventArgs e) {if (this. textBox1.Focused = false) // {this. top =-30; // set the distance between it and the edge on the workspace to-30 pixels} private void label2_Click (object sender, EventArgs e) {this. close (); // Close this form} private void panel=mouseclick (object sender, MouseEventArgs e) {Focus (); this. top = 60; // set the distance between it and the edge on the workspace to 60 pixels} private void Form1_MouseClick (object sender, MouseEventArgs e) {Focus (); this. top = 60; // set the distance between the image and the edge on the workspace to 60 pixels }}}

Toolbar with drop-down menu

To implement a toolbar with a drop-down menu, you only need to set the type of the toolbar button to DropDownButton.

 

1. Create a project. The default form is Form1. Add the ToolStrip control to the Form1 form, Add corresponding buttons to the toolbar, and select the DropDownButton type from the drop-down menu.

2. Set the corresponding drop-down menu for the buttons of the DropDownButton type in the toolbar to easily implement the toolbar with the drop-down menu.

010 toolbar with prompt Function

To implement a toolbar with the prompt function, you only need to set the ToolTipText attribute of the toolbar button to the content to be prompted.

1. Create a project. The default form is Form1. Add the ToolStrip control to the Form1 form and add corresponding buttons to the toolbar.

2. Set the prompt content for the ToolTipTile attribute of the corresponding button to easily implement the toolbar with the prompt function.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.