Loads text in a certain format from a file and inserts it into the Text Control.
TXTextControl.Load FileName[, Offset[, Format[, CurSelection]]]
Parameter | Description | |||||||||||||||||||||||||||||||||||||||||||
FileName |
Specifies the file to load from. |
|||||||||||||||||||||||||||||||||||||||||||
Offset |
Optional. Specifies the file position from where the data is read. When not specified or set to zero the data is read from the beginning. |
|||||||||||||||||||||||||||||||||||||||||||
Format |
Optional. Specifies a format identifier. When not specified Text Control assumes Text Control's internal format (3). Otherwise it can be one of the following values:
|
|||||||||||||||||||||||||||||||||||||||||||
CurSelection |
Optional. When set to true the loaded data replaces the current selection or is inserted at the current input position. The new input position is behind the inserted data. When omitted or set to false the loaded data replaces the complete control contents independent of the current selection. The new input position is at the beginning of the data. |
The method returns the position in the file after the data has been loaded.
FileName: | String |
Offset: | Long |
Format: | Integer |
CurSelection: | Boolean |
Return value: | Long |
This Basic example opens a file and loads its contents into TXTextControl1:
Private Sub mnuFile_Load_Click() On Error Resume Next ' Create an "Open File" dialog box CommonDialog1.Filter = "TX Demo (*.tx)|*.tx" CommonDialog1.DialogTitle = "Open" CommonDialog1.Flags = cdlOFNFileMustExist Or _ cdlOFNHideReadOnly CommonDialog1.CancelError = True CommonDialog1.ShowOpen If Err Then Exit Sub ' Pass the filename to the text control TXTextControl1.Load CommonDialog1.filename End Sub
<< TXTextControl.ListType Property | >> TXTextControl.LoadDialog Method