![]() The following example positions the mouse pointer between two buttons when they are clicked: private void button1_Click(object sender, EventArgs e) =>Ĭursor.Position = PointToScreen(button2.Location) ![]() The clip area, by default, is the entire screen. In addition, you can limit the area the mouse pointer can be used be setting the Clip property. You can get or set the current location of the mouse using the Position property of the Cursor. Sometimes you may want to limit the area in which the mouse pointer can be used or change the position the mouse. ![]() Private Sub Button1_MouseLeave(sender As Object, e As EventArgs) Handles Button1.MouseLeave Private Sub Button1_MouseEnter(sender As Object, e As EventArgs) Handles Button1.MouseEnter Private void button1_MouseLeave(object sender, EventArgs e) => The following example hides the cursor when the cursor is over a button: private void button1_MouseEnter(object sender, EventArgs e) => ![]() The Cursor class contains properties that describe the pointer, such as the Position and HotSpot properties, and methods that can modify the appearance of the pointer, such as the Show, Hide, and DrawStretched methods. The mouse pointer is represented by the Cursor class, and each Control has a Control.Cursor property that specifies the pointer for that control.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |