Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common properties and methods of form forms in C #

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you the "what are the common properties and methods of form forms in C#", the content is simple and clear, and I hope it can help you solve your doubts. Let me lead you to study and learn about the common properties and methods of form forms in C# "this article.

In the pursuit of writing advanced code, do not forget the most basic things, only a good grasp of the foundation will help us to fly higher and faster. This article will introduce C # form forms.

Common properties of C # form forms

(1) Name property: used to get or set the name of the form.

(2) WindowState property: used to get or set the window state of the form.

(3) StartPosition property: used to get or set the starting position of the runtime form.

(4) Text property: this property is a string property that sets or returns the text displayed in the window title bar.

(5) Width property: used to get or set the width of the form.

(6) Heigth property: used to get or set the height of the form.

(7) Left property: used to get or set the x coordinate (in pixels) of the left edge of the form.

(8) Top property: used to get or set the y coordinates of the upper edge of the form, in pixels.

(9) ControlBox property: used to get or set a value indicating whether a control box is displayed in the title bar of the form.

(10) MaximumBox property: used to get or set a value indicating whether the * * button is displayed in the title bar of the form.

(11) MinimizeBox property: used to get or set a value indicating whether the minimize button is displayed in the title bar of the form.

(12) AcceptButton property: this property is used to get or set a value that is the name of a button that is equivalent to clicking the button on the form when the user presses the ENTER key.

(13) CancelButton property: this property is used to get or set a value that is the name of a button that is equivalent to clicking the button on the form when the user presses the ESC key.

(14) Modal property: this property is used to set whether the form is displayed in mode.

The 1***ctiveControl property: used to get or set the active control in the container control.

(16) ActiveMdiChild property: used to get the currently active child window of the multi-document interface (MDI).

(17) AutoScroll property: used to get or set a value indicating whether the form implements automatic scrolling.

(18) BackColor property: used to get or set the background color of the form.

(19) BackgroundImage property: used to get or set the background image of the form.

(20) Enabled property: used to get or set a value indicating whether the control can respond to user interaction.

Font property: used to get or set the font of the text displayed by the control.

(22) ForeColor property: used to get or set the foreground color of the control.

(23) IsMdiChild property: gets a value indicating whether the form is a multi-document interface (MDI) sub-form.

The IsMdiContainer property: gets or sets a value indicating whether the form is a container for a sub-form in the multi-document interface (MDI).

(25) KeyPreview property: this property is used to get or set a value indicating whether the form will receive a key event before it is passed to the control with focus.

(26) MdiChildren attribute: array attribute.

(27) MdiParent property: this property is used to get or set the current multi-document interface (MDI) parent form of this form.

(28) ShowInTaskbar property: this property is used to get or set a value indicating whether the form is displayed in the Windows taskbar.

(29) Visible property: this property gets or sets a value indicating whether the form or control is displayed.

(30) Capture property: if the value of this property is true, the mouse is limited to respond only by this control, regardless of whether the mouse is within the scope of this control or not.

Common methods for C # form forms:

(1) Show method

The purpose of this method is to make the form display, and its calling format is:

Form name .Show ()

(2) Hide method

The purpose of this method is to hide the form and its calling format is:

Form name .Hide ()

(3) Refresh method

The purpose of this method is to refresh and redraw the form in the following format:

Form name .Refresh ()

(4) Activate method

The purpose of this method is to activate the form and give it focus. The calling format is as follows:

Form name .Activate ()

(5) Close method

The purpose of this method is to close the form. The calling format is as follows:

Form name. Close ()

(6) ShowDialog method

The purpose of this method is to display the form as a modal dialog box. The calling format is as follows:

Form name .ShowDialog ()

These are all the contents of the article "what are the common properties and methods of form forms in C#". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report