vbi-63

The Notepad application is a simple text editor. It works similar to the Notepad application included in Microsoft window. We can add only text box and menu inside the form. Insert a text box on the form and change its some property in the following format.

Object

Property

Setting

Text1 Multiline True
  Text Empty
  Left 0
  Top 0
  Hight 4000
  Width 4600
  Scrollbar 3-Both

 

Now insert menu and run the application.

 

Private Sub mnuColorBlack_Click()
    Text1.ForeColor = vbBlack
End Sub

Private Sub mnuColorBlue_Click()
    Text1.ForeColor = vbBlue
End Sub

Private Sub mnuColorGreen_Click()
    Text1.ForeColor = vbGreen
End Sub

Private Sub mnuColorRed_Click()
    Text1.ForeColor = vbRed
End Sub

Private Sub mnuFileExit_Click()
    End
End Sub

Private Sub mnuFont10Point_Click()
    Text1.Font.Size = 10
End Sub

Private Sub mnuFont12Point_Click()
    Text1.Font.Size = 12
End Sub

Private Sub mnuFont14Point_Click()
    Text1.Font.Size = 14
End Sub

Private Sub mnuFont8Point_Click()
    Text1.Font.Size = 8
End Sub

Private Sub mnuFontBold_Click()
    If mnuFontBold.Checked = True Then
        Text1.Font.Bold = False
        mnuFontBold.Checked = False
    Else
        Text1.Font.Bold = True
        mnuFontBold.Checked = True
    End If
End Sub

Private Sub mnuFontItalic_Click()
    If mnuFontItalic.Checked = True Then
        Text1.Font.Italic = False
        mnuFontItalic.Checked = False
    Else
        Text1.Font.Italic = True
        mnuFontItalic.Checked = True
    End If
End Sub

Private Sub mnuFontTimes_Click()
    Text1.Font.Name = "Times New Roman"
End Sub

Private Sub mnuHelpAbout_Click()
    MsgBox "Menu System Demo" & vbCrLf & "Design For Starting Out With Visual Basic 6.0"
End Sub

Private Sub mnuFontSansSerif_Click()
    Text1.Font.Name = "MS Sans Serif"
End Sub

VBO 63.PNG

Advertisements