-
Mail Merge -
Calculated fields in spreadsheets -
Bookmark -
Automatically generate table contents and indexes -
Hypertext links and anchors
-
Samples\WinForms\VB.NET\ Printing -
Samples\WinForms\CSharp\ Printing
-
private void mnuInsertField_Click( object sender, System. EventArgs e)
-
{
-
TXTextControl. TextField newField = new TXTextControl. TextField();
-
newField. Text = "--------" ;
-
newField. ID = fieldID;
-
fieldID += 1;
-
textControl1.TextFields. Add(newField);
-
}
-
private void textControl1_TextFieldClicked( object sender, TXTextControl. TextFieldEventArgs e)
-
{
-
// Field has been clicked on, update text of second TX and display it
-
textControl2.Text = "Field clicked, ID: " + e. TextField.ID;
-
textControl2.BringToFront();
-
}
-
private void textControl1_MouseUp( object sender, System. Windows.Forms.MouseEventArgs e)
-
{
-
textControl1.BringToFront();
-
}
-
private void mnuBookmark_Insert_Click( object sender, System. EventArgs e)
-
{
-
if (textControl1.Text == "" )
-
{
-
MessageBox. Show( "Cannot insert a bookmark if the Text Control is empty." );
-
}
-
else if (textControl1.Selection.Length == 0)
-
{
-
textControl1.Selection. Length = 1;
-
}
-
else
-
{
-
TXTextControl. TextField newField = new TXTextControl. TextField();
-
newField. ID = fieldID;
-
newField. Text = textControl1.Selection. Text;
-
textControl1.Selection. Text = "" ;
-
fieldID += 1;
-
textControl1.TextFields. Add(newField);
-
}
-
}
-
private void cmdOK_Click( object sender, System. EventArgs e)
-
{
-
if (Convert.ToInt32(textBox1.Text) > tx. TextFields.Count)
-
{
-
MessageBox. Show ( "Invalid bookmark number!" );
-
}
-
else
-
{
-
foreach (TXTextControl.TextField field in tx. TextFields)
-
{
-
if (field.ID == Convert.ToInt32(textBox1.Text))
-
{
-
tx. Selection.Start = field. Start - 1;
-
tx. Selection.Length = field. Length;
-
}
-
}
-
}
-
Close();
-
}
-
private void cmdOK_Click( object sender, System. EventArgs e)
-
{
-
TXTextControl. TextField field = new TXTextControl. TextField();
-
-
field. Name = textBox1.Text;
-
field. Text = tx. Selection.Text;
-
tx. Selection.Text = "" ;
-
-
tx. TextFields.Add(Field);
-
Close();
-
}
-
private void frmGotoDialog_Load( object sender, System. EventArgs e)
-
{
-
foreach (TXTextControl.TextField Field in tx. TextFields) {
-
ComboBox1.Items. Add(Field. Name);
-
}
-
}
-
private void cmdOK_Click( object sender, System. EventArgs e)
-
{
-
foreach (TXTextControl.TextField field in tx. TextFields)
-
{
-
if (field.Name == comboBox1.Text)
-
{
-
tx. Selection.Start = field. Start - 1;
-
tx. Selection.Length = field. Length;
-
}
-
}
-
Close();
-
}