by king (24 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 26th January 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Notepad with other options such as copy, paste, cut , fonts
write this code
Private Sub menucopy_Click()
On Error Resume Next
Clipboard.SetText rtbox.SelText
menupaste.Enabled = True
' this is the function to copy the text from the clipboard'
End Sub
*************************************************************************
on the paste event write this code
Private Sub menupaste_Click()
On Error Resume Next
rtbox.SelText = Clipboard.GetText
' this is the function to paste the text to the clipboard'
End Sub
*************************************************************************
on the cut event write this code
Private Sub menucut_Click()
On Error Resume Next
rtbox.Text = ""
end sub
*************************************************************************
on the select all event write this code
Private Sub menuall_Click()
On Error Resume Next
rtbox.SelStart = 0
rtbox.SelLength = Len(rtbox.Text)
end sub
**************************************************************************
on the time/date write this code
Private Sub menutimedate_Click()
On Error Resume Next
' this syntax helps to write both the time and date into the textbox'
rtbox.Text = Time & Format(Date)
End Sub
**************************************************************************
to show the font box write this code
Private Sub menufont_Click()
On Error Resume Next
cd.Flags = cdlCFBoth
cd.ShowFont
rtbox.SelFontName = cd.FontName
rtbox.SelFontSize = cd.FontSize
rtbox.SelBold = cd.FontBold
rtbox.SelItalic = cd.FontItalic
rtbox.SelUnderline = cd.FontUnderline
' this displays the font dialog box'
End Sub
***************************************************************************
to search the code in the note pad use the following code
On Error Resume Next
private sub search_click()
Dim compare As String
If Text Then
compare = vbTextCompare
Else
compare = vbBinaryCompare
End If
position = InStr(position + 1, frmmain.rtbox.Text, text1.Text, compare)
If position > 0 Then
frmmain.rtbox.SelStart = position - 1
frmmain.rtbox.SelLength = Len(text1.Text)
frmmain.SetFocus
frmmain.rtbox.SelBold = position - 1
frmmain.rtbox.SelColor = vbBlue
Else
MsgBox " Notepad finished searching"
End If
End Sub
*****************************************************************************
thats it easy naaaa you can make many pad applications like this...
If you want to ask me questions you are free to email me at [email protected]