C # mode form details

Source: Internet
Author: User
Tags visual studio

Overview

What is a modal form? Simple to be understood as a Form dialog box, the user must complete the action on the form or close the form before returning the form that opens the form. This article does not specifically discuss the definition, features, and functions of a pattern form, focusing mainly on how to use the modal forms effectively in a. NET form application to troubleshoot common problems encountered in using a modal form.

property settings for a modal form

A System.Windows.Forms.Form class in. NET represents a form that can be directly added through the Visual Studio 2005 designer, switching to design mode, and displaying properties and events that belong to the form in the Properties window. Refer to the standard mode form, as an example of the Option dialog box opened by the Visual Studio 2005 Program's menu tool-> option, for the form that the designer initializes is still required to be set up for specialization. Happily, these settings can be implemented in the designer mode through the property settings, the author will implement the corresponding function through the code, described in detail below.

Form.startposition property to determine the position of the form the first time it appears. This is set to appear in the middle of the parent form. This. StartPosition = formstartposition.centerparent;

Form.helpbutton property to determine if a Help button is on the title bar of the form. Settings appear to be more humane, but they do not necessarily implement the help feature.

This. HelpButton = true;

Form.maximizebox property to determine if there is a maximized box in the upper-right corner of the form's title bar. Setting does not let her show.

This. MaximizeBox = false;

Form.minimizebox property to determine if there is a minimized box in the upper-right corner of the form's title bar. Setting does not let him show.

This. MinimizeBox = false;

Form.showicon property that indicates whether an icon is displayed in the title bar of the form. Settings are not displayed.

This. Showicon = false;

Form.showintaskbar property to determine whether the form appears in the Windows taskbar. This, of course, saves the valuable space in the taskbar.

This. ShowInTaskbar = false;

Form.formborderstyle property, which indicates the appearance and behavior of the border and title bar of the form. Setting this property will not allow dragging to resize the form, and the Icon property will not display the form's title bar picture.

This. FormBorderStyle = FormBorderStyle.FixedDialog;

Form.controlbox property to determine if the form has a control/system menu box. This setting allows you to hide the control buttons for the title bar. In some cases it is still necessary to set it to false and the title bar will not have a control button.

This. ControlBox = false;

The static function of the mode form is basically realized by setting the above properties. Depending on the actual situation, the size of the form is allowed to be adjusted.

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.