Skip to content

Text.cs

DavidLandes edited this page Jan 14, 2022 · 3 revisions

Usage

  • A simple text container.

Instantiate

// Create an empty text box.
Text textBox = new Text();

// Create a text box with content.
Text name = new Text("Bill Johnson");

Set Text value

Text address = new Text();

// Add content to the text box.
address.SetText("123 Main st.");

Setting ID

Text textBox = new Text();

// Report objects can get references to their child components through IDs
// Take care to ensure IDs are unique & not duplicates.
textBox.SetId("My Unique ID");

Setting Size

Text textBox = new Text();
Text text2 = new Text();

// Set the width of the component to 90% of the parent component's width.
textBox.SetWidth(90, Measurement.Percent);

// Set the height of the component to 150 pixels.
textBox.SetHeight(150, Measurement.Px);

// Set the width of the component to 20em.
text2.SetWidth(90, Measurement.Em);

// Set the height of the component to 25pt.
text2.SetHeight(25, Measurement.Pt);

Clone this wiki locally