Windows Form 中的使用者輸入User Input in Windows Forms

Windows Form 包含一種使用者輸入模型,這種模型是以在處理相關 Windows 訊息時所引發的事件為基礎。Windows Forms includes a user input model based on events that are raised while processing related Windows messages. 本節中的主題提供滑鼠和鍵盤使用者輸入的相關資訊,包括示範如何執行特定工作的程式碼範例。The topics in this section provide information on mouse and keyboard user input, including code examples that demonstrate how to perform specific tasks.

本節內容In This Section

Windows Form 應用程式中的使用者輸入User Input in a Windows Forms Application
提供使用者輸入事件的概觀和處理 Windows 訊息的方法。Provides an overview of user input events and the methods that process Windows messages.

Windows Forms 應用程式中的鍵盤輸入Keyboard Input in a Windows Forms Application
提供鍵盤訊息處理、不同按鍵類型和鍵盤事件的相關資訊。Provides information on keyboard message handling, the different types of keys, and the keyboard events.

Windows Forms 應用程式中的滑鼠輸入Mouse Input in a Windows Forms Application
提供滑鼠事件和其他滑鼠相關功能 (包括滑鼠游標和滑鼠捕捉) 的相關資訊。Provides information on the mouse events and other mouse-related features, including mouse cursors and mouse capture.

作法:以程式碼模擬滑鼠和鍵盤事件How to: Simulate Mouse and Keyboard Events in Code
示範以程式設計方式模擬滑鼠和鍵盤輸入的幾種不同方法。Demonstrates several different ways to programmatically simulate mouse and keyboard input.

作法:處理 Windows Forms 控制項中的使用者輸入事件How to: Handle User Input Events in Windows Forms Controls
顯示處理大部分使用者輸入事件和報告每個事件相關資訊的程式碼範例。Presents a code example that handles most user input events and reports information about each event.

Windows Form 中的使用者輸入驗證User Input Validation in Windows Forms
描述在 Windows Forms 應用程式中驗證使用者輸入的方法。Describes the methods to validate user input in Windows Forms applications.

另請參閱 在 Windows Forms 中建立事件處理常式Also see Creating Event Handlers in Windows Forms.