write a program to create a notepad using common dialog
control and rich text box.

Answer Posted / fateh singh

Private Sub Form_Resize()
RTB1.Width = frmMypad.ScaleWidth
RTB1.Height = frmMypad.ScaleHeight
End Sub

Private Sub mnubold_Click()
If RTB1.SelBold = True Then
RTB1.SelBold = False
Else
RTB1.SelBold = True
End If
End Sub

Private Sub mnubullets_Click()
If RTB1.SelBullet = True Then
RTB1.SelBullet = False
Else
RTB1.SelBullet = True
End If
End Sub

Private Sub mnucenter_Click()
RTB1.SelAlignment = 2
End Sub

Private Sub mnucolor_Click()
CD1.ShowColor
RTB1.SelColor = CD1.Color
End Sub

Private Sub mnucopy_Click()
Clipboard.Clear
Clipboard.SetText (RTB1.SelText)
End Sub

Private Sub mnucut_Click()
Clipboard.Clear
Clipboard.SetText (RTB1.SelText)
RTB1.SelText = ""
End Sub

Private Sub mnudate_Click()
RTB1.SelText = Date
End Sub

Private Sub mnudateandtime_Click()
RTB1.SelText = Now
End Sub

Private Sub mnudelete_Click()
RTB1.SelText = ""

End Sub

Private Sub mnuexit_Click()
End
End Sub

Private Sub mnufonts_Click()
CD1.ShowFont
RTB1.SelBold = CD1.FontBold
RTB1.SelFontSize = CD1.FontSize
RTB1.SelFontName = CD1.FontName
RTB1.SelItalic = CD1.FontItalic

End Sub

Private Sub mnuitalic_Click()
If RTB1.SelItalic = True Then
RTB1.SelItalic = False
Else
RTB1.SelItalic = True
End If
End Sub

Private Sub mnuleft_Click()
RTB1.SelAlignment = 0
End Sub

Private Sub mnunew_Click()
RTB1.Text = ""
frmMypad.Caption = "Mypad-Newfile"
End Sub

Private Sub mnuopen_Click()
CD1.ShowOpen
RTB1.FileName = CD1.FileName
frmMypad.Caption = "Mypad-" & CD1.FileTitle
End Sub

Private Sub mnupaste_Click()
RTB1.SelText = Clipboard.GetText
End Sub

Private Sub mnuprint_Click()
CD1.ShowPrinter
End Sub

Private Sub mnuright_Click()
RTB1.SelAlignment = 1
End Sub

Private Sub mnusave_Click()
CD1.DefaultExt = "Doc"
If frmMypad.Caption = "Mypad-Newfile" Then
CD1.ShowSave
End If
RTB1.SaveFile (CD1.FileName)
frmMypad.Caption = "Mypad-" & CD1.FileTitle
End Sub

Private Sub mnusaveas_Click()
CD1.DefaultExt = "Doc"
CD1.ShowSave
RTB1.SaveFile (CD1.FileName)
frmMypad.Caption = "Mypad-" & CD1.FileTitle
End Sub

Private Sub mnutime_Click()
RTB1.SelText = Time

End Sub

Private Sub mnuunderline_Click()
If RTB1.SelUnderline = True Then
RTB1.SelUnderline = False
Else
RTB1.SelUnderline = True
End If
End Sub

Is This Answer Correct ?    10 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how exactly is the lngColour used?

1878


Write a script to delete all the files in a folder except one desired file.

1001


create a .dll component operation and use created component in another project. required methods events and properties. connect, add,search,data report

2183