Monday, 8 November 2021
How to save richtextbox data to a text file in visual basic | Export dat...
How to save richtextbox data to a text file in visual basic | Export data to a text file or RTF file | How to save richtextbox content to a file in visual basic |Visual Basic 6 Step by Step Tutorial
In the Part:1, we have demonstrated "How to Load data from a text file (RTF) to Richtextbox using Common Dialog Control and Richtextbox Control
in Visual Basic" and How to Clear Rich Text Box Control.
In Part:2, we have discussed about "How to save Richtextbox data to a Text File or RTF file".
All steps are explained in detail,no step is skipped while making this video tutorial.
Step by Step Tutorial
Code
Dim data As String
Dim check As Integer
Dim filename As String
Private Sub Command1_Click()
opendialog.Filter = "Text Files (*.txt)|*.txt|RTf Files (*.rtf)|*.rtf|"
opendialog.ShowOpen
data = opendialog.filename
''check = Len(data)
If opendialog.filename = "" Then
MsgBox "You click on Cancel!! Kindly Select the file you want to load", vbOKOnly + vbCritical
Else
RichTextBox1.LoadFile (data)
End If
End Sub
Private Sub findbtn_Click()
opendialog.Filter = "Text Files (*.txt)|*.txt|RTf Files (*.rtf)|*.rtf|"
opendialog.ShowSave
filename = opendialog.filename
RichTextBox1.SaveFile filename, rtfText
End Sub
Wednesday, 3 November 2021
How to Load data from a text file to RichTextBox control using Dialog Co...
How to Load data from Text (.txt) and RTF (.rtf) file to Richtextbox control using Common Dialog control in Visual Basic 6 .Also Clear the richtextbox control.Visual Basic Tutorial-Step by step Tutorial,No Step skipped.
In the Part-1 of this Video, we will discuss following points
1.How to add Richtextbox and Common Dialog Control in the Visual Basic Project.
2.How to Use Richtextbox and Common Dialog Control and set their properties.
3.How to load data from a text file to Richtextbox using Open Dialog control and Command Button.In open Dialog, we will select any text file from the PC and Open that file content into the richtextbox control.
4.How to clear the richtextbox.
All steps are explained in detail,no step is skipped .
Next Part-2 ,we will discuss about Saving data from a richtextbox to a text .txt file and RTF .rtf file and store in PC.
Code:
Dim data As String
Private Sub loadbtn_Click()
opendialog.Filter = "Text File(*.txt)|*.txt|RTF File(*.rtf)|*.rtf|"
opendialog.ShowOpen
data = opendialog.FileName
RichTextBox1.LoadFile (data)
End Sub
Private Sub clearbtn_Click()
RichTextBox1.Text = ""
End Sub
Monday, 24 September 2018
How to install visual basic 6.0 on windows 7,8
How to install visual basic 6.0 on windows 7,8 &10 (32 bit & 64 bit operating system)-Step by step tutorial.
in this video ,you can easily find the way to install visual basic 6.0 on windows operating system.
Subscribe to:
Posts (Atom)