The Big Red Toolbox

MGCERichInk

A Rich Ink (Scratchpad) Control

October 24, 1999

© NSB Corporation. All rights reserved.


MGCERichInk - Windows CE Custom Control Object
Written by Mark Gamber, October 1999

NS Basic is (c) NS Basic Corporation
Windows CE is (c) Microsoft Corporation

MGCERichInk provides a rich ink (scratchpad) control to Windows CE applications capable of making use of COM oriented controls such as NS Basic. Included in this package are:

Object Creation

AddObject "MGCERichInk.RichInk", "Name", x, y, xsize, ysize

Samples


Properties

Border Set and retrieve the control border state. False (zero) removes a border and True (non-zero) displays a border around the control.

RInk.Border = True hasBorder = RInk.Border

Data Set and retrieve binary data which makes up the contents of the control.

Dim a
a = RInk.Data RInk.Data = a

Mode Set and retrieve the control's display mode. True (non-zero) sets the control into graphical mode and False (zero) puts the control into text mode. Note that the Clear property automatically sets the control into Text mode.

RInk.Mode = True ' Go to graphical mode iMode = RInk.Mode

Tabstop Set and retrieve the tabstop state of the control. If set to True (non-zero), the control is included in the form tab order. When False (zero), the control is not added to the form tab order.

RInk.Tabstop = False bTab = RInk.Tabstop

Toolbar Set and retrieve the state of the control's toolbar. Set to True (non-zero) to display the toolbar and False (zero) to remove the toolbar. By default, the toolbar is enabled.

RInk.Toolbar = False bToolbar = RInk.Toolbar

Version Read-only property used to determine the version of this control.

v = RInk.Version


Methods

Clear Clear removes all data from the control and sets the control into Text mode. The toolbar is unaffected by Clear.

RInk.Clear

Hide The Hide method removes the control from the display.

RInk.Hide

LoadData The LoadData method loads RichInk data from a specified filename. The file contents are also known as a "PWI" or "Pocket Word Ink" type of type.

RInk.LoadData "filename.ext"

SaveData SaveData saves the contents of the control to a specified file. A second parameter determines the action to take if the specified file already exists. If a specified file exists and the parameter is set to ZERO, the file is not written over and the control throws an error. If set to a non-zero number, the existing file is written over with the current control contents and no error occurs unless the file could not be created for another reason.

RInk.SaveData "Signature.ink", 1 ' Overwrite existing file

SetFocus Forces the input focus to the control.

RInk.SetFocus

Show Displays the rich ink control if it is hidden.

RInk.Show


Events

The Rich Ink control does not support events.

Change Log