Kria Notepad

KRIA NOTEPAD HO VISUAL BASIC 6.0

Etapa Dezemvolve"Sidauk Prontu ho diak"
         Kria software ka programa Notepad husi Visual Basic 6.0,  tuir mai maluk sira bele halo lalaok ka matadalan nebe iha ona hodi bele kria rasik notepad ba imi nia PC. Lalaos mak hanesan tuir mai ne'e :
Desenho iha Form nia laran Text1 (ida) ho CommonDialog (Ida) hare tuir imagen, depois kria nia Menu hare mos iha imagen,



Bainhira hotu ona atur nia valor sira iha Properties, depois klik nia menu sira nebe ohin kria ona, hodi hatama listing/kodigu hanesan tuir mai ne'e :

Private Sub ajuda_Click()
MsgBox ("Programa ne'e Kria hodi tulun Joven Timor oan nebe hakrak aprende no dezemvolve aplikasaun saida deit tuir ida ida nia konhecimento""Notepad VBDeo")
End Sub

Private Sub foun_Click()
Text1.Text = ""
End Sub

Private Sub guarda_Click()
On Error GoTo ErrorHandler
CommonDialog1.Filter = "All Files (*.*)|*.*|Text Files (*.txt)|*.txt"
CommonDialog1.FilterIndex = 2
CommonDialog1.ShowSave
CommonDialog1.FileName = CommonDialog1.FileName
Dim iFile As Integer
Dim SaveFileFromTB As Boolean
Dim TxtBox As Object
Dim FilePath As String
Dim Append As Boolean
iFile = FreeFile
If Append Then
Open CommonDialog1.FileName For Append As ‪#‎iFile‬
Else
Open CommonDialog1.FileName For Output As #iFile
End If
Print #iFile, Text1.Text
SaveFileFromTB = True
ErrorHandler:
Close #iFile
End Sub

Private Sub imprimi_Click()
On Error GoTo ErrHandler
Dim BeginPage, EndPage, NumCopies, i
CommonDialog1.CancelError = True
CommonDialog1.ShowPrinter
BeginPage = CommonDialog1.FromPage
EndPage = CommonDialog1.ToPage
NumCopies = CommonDialog1.Copies
For i = 1 To NumCopies
Printer.Print Text1.Text
Next i
Exit Sub
ErrHandler:
Exit Sub
End Sub

Private Sub koa_Click()
Clipboard.Clear
Clipboard.SetText Text1.SelText
Text1.SelText = ""
End Sub

Private Sub kolar_Click()
Text1.SelText = Clipboard.GetText()
End Sub

Private Sub kopia_Click()
Clipboard.Clear
Clipboard.SetText Text1.SelText
End Sub

Private Sub loke_Click()
CommonDialog1.Filter = "All Files (*.*)|*.*|Text Files (*.txt)|*.txt"
CommonDialog1.FilterIndex = 2
CommonDialog1.ShowOpen
Dim LoadFileToTB As Boolean
Dim TxtBox As Object
Dim FilePath As String
Dim Append As Boolean
Dim iFile As Integer
Dim s As String
If Dir(FilePath) = "" Then Exit Sub
On Error GoTo ErrorHandler:
s = Text1.Text
iFile = FreeFile
Open CommonDialog1.FileName For Input As #iFile
s = Input(LOF(iFile), #iFile)
If Append Then
Text1.Text = Text1.Text & s
Else
Text1.Text = s
End If
LoadFileToTB = True
ErrorHandler:
If iFile > 0 Then Close #iFile
End Sub

Private Sub taka_Click()
If MsgBox("Hakarak taka Duni Programa ne'e?", vbQuestion + vbYesNo, "Informasaun VBDeo") = vbYes Then
End
End If
End Sub