JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Immediate Solutions: Setting the Mouse Pointer in Controls

I'll start off this section by taking a look at a very useful property of the Control class—Cursor. You can use this property to set the mouse cursor type when the mouse moves over a control. (Keep in mind that Windows forms are also derived from the Control class so it works for forms, too.) Just set the Cursor (formerly Mousepointer in VB6 and before) property to one of the values in Table 5.4.

Table 5.4: Mouse cursor options.

Constant

Description

AppStarting

Cursor that is displayed when an application starts.

Arrow

Arrow cursor.

Cross

Crosshair cursor.

Default

Default cursor, usually an arrow cursor.

Hand

Hand cursor, usually used when hovering over a Web link.

Help

Help cursor, a combination of an arrow and a question mark.

HSplit

Cursor that appears when the mouse is positioned over a horizontal splitter bar.

IBeam

I-beam cursor, used to show where the text cursor appears when the mouse is clicked.

No

Cursor that indicates that a particular region is invalid for the current operation.

NoMove2D

Cursor for mouse wheel operations when the mouse is not moving, but the window can be scrolled in either a horizontal and vertical direction.

NoMoveHoriz

Cursor for mouse wheel operations when the mouse is not moving, but the window can be scrolled in a horizontal direction.

NoMoveVert

Cursor for mouse wheel operations when the mouse is not moving, but the window can be scrolled in a vertical direction.

PanEast

Cursor for mouse wheel operations when the mouse is moving and the window is scrolling horizontally to the right.

PanNE

Cursor for mouse wheel operations when the mouse is moving and the window is scrolling horizontally and vertically upward and to the right.

PanNorth

Cursor for mouse wheel operations when the mouse is moving and the window is scrolling vertically in an upward direction.

PanNW

Cursor for mouse wheel operations when the mouse is moving and the window is scrolling horizontally and vertically upward and to the left.

PanSE

Cursor for mouse wheel operations when the mouse is moving and the window is scrolling horizontally and vertically downward and to the right.

PanSouth

Cursor for mouse wheel operations when the mouse is moving and the window is scrolling vertically in a downward direction.

PanSW

Cursor for mouse wheel operations when the mouse is moving and the window is scrolling horizontally and vertically downward and to the left.

PanWest

Cursor for mouse wheel operations when the mouse is moving and the window is scrolling horizontally to the left.

SizeAll

Four-headed sizing cursor.

SizeNESW

Two-headed diagonal (northeast/southwest) sizing cursor.

SizeNS

Two-headed vertical (north/south) sizing cursor.

SizeNWSE

Two-headed diagonal (northwest/southeast) sizing cursor.

SizeWE

Two-headed horizontal (west/east) sizing cursor.

UpArrow

Up-arrow cursor, usually used to identify an insertion point.

VSplit

Cursor that appears when the mouse is over a vertical splitter bar.

WaitCursor

Wait cursor, usually an hourglass shape.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor