In trực tiếp trong windows form
Chuyển đến nội dung chính Trình duyệt này không còn được hỗ trợ nữa. Show Hãy nâng cấp lên Microsoft Edge để tận dụng các tính năng mới nhất, bản cập nhật bảo mật và hỗ trợ kỹ thuật. How to: Add Controls Without a User Interface to Windows Forms
Trong bài viết nàyA nonvisual control (or component) provides functionality to your application. Unlike other controls, components do not provide a user interface to the user and thus do not need to be displayed on the Windows Forms Designer surface. When a component is added to a form, the Windows Forms Designer displays a resizable tray at the bottom of the form where all components are displayed. Once a control has been added to the component tray, you can select the component and set its properties as you would any other control on the form. Add a component to a Windows Form
Furthermore, components can be added to a form at run time. This is a common scenario, especially because components do not have a visual expression, unlike controls that have a user interface. In the example below, a Timer component is added at run time. (Note that Visual Studio contains a number of different timers; in this case, use a Windows Forms Timer component. For more information about the different timers in Visual Studio, see Introduction to Server-Based Timers.) Caution Components often have control-specific properties that must be set for the component to function effectively. In the case of the Timer
component below, you set the Add a component to a Windows Form programmatically
See also
Phản hồiGửi và xem ý kiến phản hồi dành cho Chuyển đến nội dung chính Trình duyệt này không còn được hỗ trợ nữa. Hãy nâng cấp lên Microsoft Edge để tận dụng các tính năng mới nhất, bản cập nhật bảo mật và hỗ trợ kỹ thuật.
Control.Enter Event
DefinitionIn this articleOccurs when the control is entered.
Event TypeEventHandlerExamplesThe following code example uses the Enter event to change the foreground and background colors of a TextBox under particular conditions.
RemarksWhen you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), by calling the Select or SelectNextControl methods, or by setting the ContainerControl.ActiveControl property to the current form, focus events occur in the following order:
When you change the focus by using the mouse or by calling the Focus method, focus events occur in the following order:
If the
CausesValidation property is set to For more information about handling events, see Handling and Raising Events. Applies toSee also
|