Text format and different type of text in Tx Text Control which use in a report
In a report we use different type of text like heading, subheading, normal text, color of text, text color, italic text and text alignment. Here I am discuss these by program in Tx text Control.
- Selection :- It is property of Tx text control which select the text to format. You all are very aware with MS Office and other tools to make report and other important documents by GUI. Like MS Office, by selecting text we can format it as bold, italic, underling, set color of selected text and set text length. Selection have to two properties start and length. Start define, from where we have to start and length define to where. for example - var tx= new SeverTextControl();
tx.Create();
tx.Text = "TechPerspect";
tx.Selection.Start = 0;
tx.Selection.Length = 3;// index 1 to 4 ("Tech") is selected
tx.Selection.ParagraphFormat.Alignment = TXTextControl.HorizontalAlignment.Right;
tx.Selection.ParagraphFormat.TopDistance = 0;
tx.Selection.Bold = True;
- Next Line : Tx Text Control provide character with back slash to move next line. it use in paragraph and table text .
tx.Selection.Length = 0;
tx.Selection.Start = tx.Text.Length + 1;
tx.Selection.Text = "\r\n";
- Next Page : we can move next page manually. it provide a character with back slash to move next line.
tx.Selection.Text = "\f";
Output
- Color Of Text : We can set any color of text and paragraph text to make attractive look of report. Tx Text Control have a property name "ForeColor " for set color of text and we assign value in the form of RGB Type. The valid range for a RGB color is 0 to &HFFFFFF.
tx.Selection.ForeColor = System.Drawing.Color.Beige;
tx.Create();
tx.Text = "TechPerspect";
tx.Selection.Start = 0;
tx.Selection.Length = 3;// index 1 to 4 ("Tech") is selected
tx.Selection.ParagraphFormat.Alignment = TXTextControl.HorizontalAlignment.Right;
tx.Selection.ParagraphFormat.TopDistance = 0;tx.Selection.Bold = True;
tx.Selection.Length = 0;
tx.Selection.Start = tx.Text.Length + 1;
tx.Selection.Text = "\r\n";tx.Selection.Text = "\f";
Output |
tx.Selection.ForeColor = System.Drawing.Color.Beige;
No comments:
Post a Comment