| Flash for .NET Task-Based Help > C1FlashCanvas Tasks > Drawing Text in C1FlashCanvas > Drawing a Paragraph |
To draw a paragraph within a rectangle region, complete the following tasks:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim font As New Font("Courier New", 14, FontStyle.Regular)
Dim rect As New Rectangle(20, 20, 300, 300)
Dim s As String
s = "ComponentOne was formed on July 1, 2000, by the merger of APEX Software Corporation and VideoSoft. Both APEX and VideoSoft have a history of leadership in the Microsoft Visual Studio component industry."
Me.C1FlashCanvas1.DrawString(s, font, Brushes.DarkRed, rect)
font.Dispose()
End Sub
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
private void Form1_Load(object sender, System.EventArgs e)
{
Rectangle rect = new Rectangle(20, 20, 300, 300);
Font font = new Font("Courier New", 14, FontStyle.Regular);
string s = "ComponentOne was formed on July 1, 2000, by the merger of APEX Software Corporation and VideoSoft. Both APEX and VideoSoft have a history of leadership in the Microsoft Visual Studio component industry.";
this.c1FlashCanvas1.DrawString(s, font, Brushes.DarkRed, rect);
font.Dispose();
}
|
|
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1FlashCanvas1.RenderToFile("c:\c1flash_canvas_text.swf")
LaunchViewer("c:\c1flash_canvas_text.swf")
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.C1FlashCanvas1.RenderToFile(@"c:\c1flash_canvas_text.swf"); LaunchViewer(@"c:\c1flash_canvas_text.swf"); |
|
Here is what your text will look like in Internet Explorer:
