ActiveReports3 Request technical support
Load Method
See Also  Example


stream
type
Loads the contents of a stream into the RichTextBox control.
A stream of rich text data to be loaded into the control.

RichTextType enumeration.

Syntax

Visual Basic (Declaration) 
Public Sub Load( _
   ByVal stream As Stream, _
   ByVal type As RichTextType _
) 
Visual Basic (Usage)Copy Code
Dim instance As RichTextBox
Dim stream As Stream
Dim type As RichTextType
 
instance.Load(stream, type)
C# 
public void Load( 
   Stream stream,
   RichTextType type
)

Parameters

stream
type

Example

To use this sample code, you will need a sample.rtf file and a sample.html file as well as two RichTextBox controls on an ActiveReport.
C#Copy Code
private void Detail_Format(object sender, System.EventArgs eArgs)
{
   System.IO.FileStream streamR =
new System.IO.FileStream(System.Windows.Forms.Application.StartupPath + "\\sample.rtf", System.IO.FileMode.Open);
   rtfRTF.Load(streamR, RichTextType.Rtf);

   System.IO.FileStream streamH =
new System.IO.FileStream(System.Windows.Forms.Application.StartupPath + "\\sample.html", System.IO.FileMode.Open);
   rtfHTML.Load(streamH, RichTextType.Html);
}
Visual BasicCopy Code
Private Sub Detail_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail.Format
    Dim streamR As New System.IO.FileStream(Application.StartupPath & "\sample.rtf", IO.FileMode.Open)
    rtfRTF.Load(streamR, RichTextType.Rtf)
    Dim streamH As New System.IO.FileStream(Application.StartupPath & "\sample.html", IO.FileMode.Open)
    rtfHTML.Load(streamH, RichTextType.Html)
End Sub

Remarks

The data loaded from the stream replaces the existing text in the RichTextBox.

See Also