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



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

Answer / 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

More Visual Basic Code Interview Questions

how to generate Question paper and how to save pattern of question paper

2 Answers  


how exactly is the lngColour used?

0 Answers  


problem no.3 - write a program using two dimentional arrays that compute the sum of data in rows and sum of data in columns of the 3*3 array variable. sample input/output dialog 5 9 8 = 22 3 8 2 = 13 4 3 9 = 16 _____________ 12 20 19

4 Answers   CSS,


I need help for Source Code & design of my school thesis enrollment system using visual basic 6.0/2008 database MS Access 2007. Please help me friends...Thanks...

1 Answers  


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

1 Answers  






Write a code snippets to find greatest and least of any number of inputs without taking the help of array

1 Answers   Infosys, Wipro,


Write a Program in Visual Basic by means of which we can send any data from Visual basic program to any other application running on that machine whether that application supports OLE or not.....

1 Answers  


swap two no without using third variable

7 Answers  


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

0 Answers  


I have string str="Arts And Props" now i want to replace space in string with null. means i want result as str="ArtsAndProps"

1 Answers  


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

0 Answers  


Categories