1. Form and interface design-Title Bar Form

Source: Internet
Author: User

The title bar is a prominent position. Adding buttons or personalized settings at this position will give you a novel feeling.

036 align the text in the form title bar to the right

It is very easy to implement this function in C #4.0. You only need to set the RightToLeft attribute of the form to Yes.

The Form. RightToLeft attribute is used to obtain or set a value that indicates whether to align the elements of the control to support the use of area settings from right to left.

Create a project. The default form is Form1. Add a background image for the Form1 form and set the RightToLeft attribute to Yes.

037 window with no title bar but size can be changed

The window style is determined when the window is created. in C #, there is no title bar but the size of the window can be changed, one clever way is to set the Text attribute of the form to null and the ControlBox attribute to False.

: The Text attribute of the form must be set to null.

Create a project. The default form is Form1. Add the Label control and Button control for the Form1 form to design the interface.

Namespace _ 037_NoWindowsTitle {public partial class Form1: Form {public Form1 () {InitializeComponent ();} private void Form1_Load (object sender, EventArgs e) {ControlBox = false; // do not display controls in the Form title bar} private void button#click (object sender, EventArgs e) {Close ();}}}

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.