Method CreateSimpleDialogText
CreateSimpleDialogText(String, Int32, Int32, Color, Color)
Writes a text field in the simple dialog mode.
Declaration
Error CreateSimpleDialogText(string text, int column, int row, Color textColor, Color backgroundColor)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text to be written. |
System.Int32 | column | The column of the upper left corner of the text field. |
System.Int32 | row | The row of the upper left corner of the text field. |
System.Drawing.Color | textColor | The foreground color of the text. |
System.Drawing.Color | backgroundColor | The background color of the text field |
Returns
Type | Description |
---|---|
Error |
Remarks
Writing text requires a font to be be loaded with
SetSimpleDialogResourceFont(String, SimpleDialogFileLoadOptions).
Text is written to the invisible shadow buffer. To make it visible,
UpdateSimpleDialogDisplay(CopyBufOption) with the option
Examples
The following example initiates the simple dialog mode, loads a font, writes text to the shadow buffer, and makes the written text visible.
C#
Error error = driver.SetSimpleDialogMode();
string pathToFont = "Resources" + Path.DirectorySeparatorChar + "arial20.sof";
error = driver.SetSimpleDialogResourceFont(pathToFont,
SimpleDialogFileLoadOptions.LoadNewFileToPad);
error = driver.CreateSimpleDialogText("Hello. This is a simple dialog text.",
100, 0, Color.Black, Color.AntiqueWhite);
error = driver.CreateSimpleDialogText("Another text.",
100, 30, Color.Black, Color.AntiqueWhite);
//Text is written to the shadow buffer, update
error = driver.UpdateSimpleDialogDisplay(
CopyBufOption.DoNotCopyCurrentToShadowBeforeSwitching);
A similar program in
VB.NET
Dim r As Sig.DeviceAPI.Error
r = driver.SetSimpleDialogMode()
Dim pathToFont As String = "Resources" + Path.DirectorySeparatorChar + "arial20.sof"
r = driver.SetSimpleDialogResourceFont(pathToFont,
SimpleDialogFileLoadOptions.LoadNewFileToPad)
r = driver.CreateSimpleDialogText("Hello. This is a simple dialog text.",
100, 0, Color.Black, Color.AntiqueWhite)
r = driver.CreateSimpleDialogText("Another text.",
100, 30, Color.Black, Color.AntiqueWhite)
'Text is written to the shadow buffer, update
r = driver.UpdateSimpleDialogDisplay(
CopyBufOption.DoNotCopyCurrentToShadowBeforeSwitching)