This article is about a mouse and the Mouse object of Microsoft Small Basic programming language.



What is a Mouse

According to Dictionary object of Small Basic, there are two meanings for a word mouse. 

  1. small rodent
    a small rodent that has a brown or grayish brown coat and a long, mostly hairless tail.  Family:  Muridae, Cricetidae
  2. computer controlling device
    a handheld input device with control buttons that is moved across a pad to control the movement of a cursor on a computer screen or is clicked to transmit instructions
Of course, this article is about the second meaning.

Mouse Object

Mouse object in Small Basic has 4 properties and 2 operations.

  • IsLeftButtonDown - "True" if the mouse left button is down
  • IsRightButtonDown -  "True" if the mouse right button is down
  • MouseX - mouse x position in the desktop coordinate
  • MouseY - mouse y position in the desktop coordinate
  • HideCursor - operation to hide the mouse pointer (cursor)
  • ShowCursor - operation to show the mouse pointer (cursor) 

Mouse in GraphicsWindow Object

Following 2 properties and 3 events in GraphicsWindow object are also for mouse programming.

  • MouseX - mouse x position in the graphics window coordinate
  • MouseY - mouse y position in the graphics window coordinate
  • MouseDown - mouse down event
  • MouseMove - mouse move event
  • MouseUp - mouse up event

Sample Programs

  • Mouse Object Sample (MWC343) - sample code for Mouse object
  • Drag and Drop Sample (NWQ566) - drag and drop sample code using GraphicsWindow properties and events for mouse 

See Also