VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Is a word processor capable of performing several functions apart from simple file handling or text

by Aman Moudgil (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Mon 20th December 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Is a word processor capable of performing several functions apart from simple file handling or text editting...Has the MDI utility and one can

API Declarations


Unload Me
Set richtextc1 = Nothing
End Sub

Private Sub Combo1_Change()

End Sub

Private Sub Combo2_Change()
If Combo2.Text = "Times New Roman" Then
RichTextBox1.Font = "Times New Roman"
Text1.Font = "Times New Roman"
Else
End If
If Combo2.Text = "MS" Then
RichTextBox1.Font = "MS Sans Serif"
Text1.Font = "MS Sans Serif"
Else
End If
If Combo2.Text = "Arial" Then
RichTextBox1.Font = "Arial"
Text1.Font = "Arial"
Else
End If
If Combo2.Text = "Bookman Old Style" Then
RichTextBox1.Font = "Bookman Old Style"
Text1.Font = "Bookman Old Style"
Else
End If
If Combo2.Text = "Century" Then
RichTextBox1.Font = "Century"
Text1.Font = "Century"
Else
End If
If Combo2.Text = "Arial Black" Then
RichTextBox1.Font = "Arial Black"
Text1.Font = "Arial Black"
Else
End If
If Combo2.Text = "Century Gothic" Then
RichTextBox1.Font = "Century Gothic"
Text1.Font = "Century Gothic"
Else
End If
If Combo2.Text = "Impact" Then
RichTextBox1.Font = "Impact"
Text1.Font = "Impact"
Else
End If
If Combo2.Text = "Bookman Antiqua" Then
RichTextBox1.Font = "Bookman Antiqua"
Text1.Font = "Bookman Antiqua"
Else
End If
If Combo2.Text = "Comic Sans MS" Then
RichTextBox1.Font = "Comic Sans MS"
Text1.Font = "Comic Sans MS"
Else
End If
If Combo2.Text = "Fixedsys" Then
RichTextBox1.Font = "Fixedsys"
Text1.Font = "Fixedsys"
Else
End If
If Combo2.Text = "MS Serif" Then
RichTextBox1.Font = "MS Serif"
Text1.Font = "MS Serif"
Else
End If
End Sub

Private Sub Command1_Click()
RichTextBox1.SelBold = False
RichTextBox1.SelItalic = False
RichTextBox1.SelUnderline = False
RichTextBox1.SelStrikeThru = False
RichTextBox1.SelFontSize = 8
End Sub

Private Sub Command10_Click()
Dim sfile As String
With CommonDialog1
.Filter = "All Files (*.rtf)|*.rtf"
CommonDialog1.ShowSave
sfile = .filename
Open sfile For Output As 1
Print #1, RichTextBox1.TextRTF
End With
Close
End Sub

Private Sub Command11_Click()
With CommonDialog1
.Filter = "All Files (*.rtf)|*.rtf"
.ShowOpen
If Len(.filename) = 0 Then
Exit Sub
End If
sfar = .filename
Kill sfar
End With
End Sub

Private Sub Command12_Click()
With CommonDialog1
.Filter = "All Files (*.rtf)|*.rtf"
.ShowPrinter
If Len(.filename) = 0 Then
Exit Sub
End If
sfar = .filename
End With
End Sub

Private Sub Command13_Click()
Dim asd As AlignmentConstants
Dim dfg As AlignmentConstants
asd = vbCenter
dfg = vbRightJustify
RichTextBox1.RightMargin = dfg
RichTextBox1.SelAlignment = asd
End Sub

Private Sub Command14_Click()
Dim a As AlignmentConstants
Dim d As AlignmentConstants
a = vbLeftJustify
d = vbRightJustify
RichTextBox1.RightMargin = d
RichTextBox1.SelAlignment = a
End Sub

Private Sub Command15_Click()
Dim s As AlignmentConstants
Dim f As AlignmentConstants

Rate Is a word processor capable of performing several functions apart from simple file handling or text



Unload Me
Set richtextc1 = Nothing
End Sub

Private Sub Combo1_Change()

End Sub

Private Sub Combo2_Change()
If Combo2.Text = "Times New Roman" Then
RichTextBox1.Font = "Times New Roman"
Text1.Font = "Times New Roman"
Else
End If
If Combo2.Text = "MS" Then
RichTextBox1.Font = "MS Sans Serif"
Text1.Font = "MS Sans Serif"
Else
End If
If Combo2.Text = "Arial" Then
RichTextBox1.Font = "Arial"
Text1.Font = "Arial"
Else
End If
If Combo2.Text = "Bookman Old Style" Then
RichTextBox1.Font = "Bookman Old Style"
Text1.Font = "Bookman Old Style"
Else
End If
If Combo2.Text = "Century" Then
RichTextBox1.Font = "Century"
Text1.Font = "Century"
Else
End If
If Combo2.Text = "Arial Black" Then
RichTextBox1.Font = "Arial Black"
Text1.Font = "Arial Black"
Else
End If
If Combo2.Text = "Century Gothic" Then
RichTextBox1.Font = "Century Gothic"
Text1.Font = "Century Gothic"
Else
End If
If Combo2.Text = "Impact" Then
RichTextBox1.Font = "Impact"
Text1.Font = "Impact"
Else
End If
If Combo2.Text = "Bookman Antiqua" Then
RichTextBox1.Font = "Bookman Antiqua"
Text1.Font = "Bookman Antiqua"
Else
End If
If Combo2.Text = "Comic Sans MS" Then
RichTextBox1.Font = "Comic Sans MS"
Text1.Font = "Comic Sans MS"
Else
End If
If Combo2.Text = "Fixedsys" Then
RichTextBox1.Font = "Fixedsys"
Text1.Font = "Fixedsys"
Else
End If
If Combo2.Text = "MS Serif" Then
RichTextBox1.Font = "MS Serif"
Text1.Font = "MS Serif"
Else
End If
End Sub

Private Sub Command1_Click()
RichTextBox1.SelBold = False
RichTextBox1.SelItalic = False
RichTextBox1.SelUnderline = False
RichTextBox1.SelStrikeThru = False
RichTextBox1.SelFontSize = 8
End Sub

Private Sub Command10_Click()
 Dim sfile As String
    With CommonDialog1
     .Filter = "All Files (*.rtf)|*.rtf"
    CommonDialog1.ShowSave
     sfile = .filename
    Open sfile For Output As 1
    Print #1, RichTextBox1.TextRTF
    End With
    Close
End Sub

Private Sub Command11_Click()
 With CommonDialog1
        .Filter = "All Files (*.rtf)|*.rtf"
        .ShowOpen
        If Len(.filename) = 0 Then
            Exit Sub
        End If
        sfar = .filename
        Kill sfar
End With
End Sub

Private Sub Command12_Click()
With CommonDialog1
        .Filter = "All Files (*.rtf)|*.rtf"
        .ShowPrinter
        If Len(.filename) = 0 Then
            Exit Sub
        End If
        sfar = .filename
End With
End Sub

Private Sub Command13_Click()
Dim asd As AlignmentConstants
Dim dfg As AlignmentConstants
asd = vbCenter
dfg = vbRightJustify
RichTextBox1.RightMargin = dfg
RichTextBox1.SelAlignment = asd
End Sub

Private Sub Command14_Click()
Dim a As AlignmentConstants
Dim d As AlignmentConstants
a = vbLeftJustify
d = vbRightJustify
RichTextBox1.RightMargin = d
RichTextBox1.SelAlignment = a
End Sub

Private Sub Command15_Click()
Dim s As AlignmentConstants
Dim f As AlignmentConstants
s = vbRightJustify
f = vbRightJustify
RichTextBox1.RightMargin = f
RichTextBox1.SelAlignment = s
End Sub

Private Sub Command16_Click()
Dim am As String
With CommonDialog1
        .Filter = "All Colors"
        .ShowColor
        am = .Color
RichTextBox1.SelColor = am
End With
End Sub

Private Sub Command17_Click()
Dim Search, Where
Search = InputBox("Enter text to be found:")
Where = InStr(RichTextBox1.Text, Search)
If Where Then
RichTextBox1.SelStart = Where - 1
RichTextBox1.SelLength = Len(Search)
Else
MsgBox "String not found."
End If
End Sub

Private Sub Command18_Click()

End Sub

Private Sub Command2_Click()
RichTextBox1.SelBold = True
End Sub

Private Sub Command3_Click()
RichTextBox1.SelStrikeThru = True
End Sub

Private Sub Command4_Click()
Dim sfar As String
    With CommonDialog1
        .Filter = "All Files (*.rtf)|*.rtf"
        .ShowOpen
        sfar = .filename
Open sfar For Input As 1
RichTextBox1.TextRTF = Input$(LOF(1), 1)
End With
Close
End Sub

Private Sub Command5_Click()
RichTextBox1.SelItalic = True
End Sub

Private Sub Command6_Click()
RichTextBox1.SelUnderline = True
End Sub

Private Sub Command7_Click()
RichTextBox1.SelBullet = True
End Sub

Private Sub Command8_Click()
Combo2.Visible = True
List1.Visible = True
Frame1.Visible = True
List2.Visible = True
Text1.Visible = True
End Sub

Private Sub Command9_Click()
Frame1.Visible = False
Combo2.Visible = False
List1.Visible = False
List2.Visible = False
Text1.Visible = False
End Sub

Private Sub COPY_Click()
MsgBox "Press Ctrl+C to copy the selected text"
End Sub

Private Sub CUT_Click()
MsgBox "Press Ctrl+X to cut the selected text"
End Sub

Private Sub PASTE_Clicks()
MsgBox "Press Ctrl+V to paste the copied/cutted text"
End Sub

Private Sub Form_Load()
Combo2.Visible = False
Frame1.Visible = False
List2.Visible = False
List1.Visible = False
Text1.Visible = False
Dim name As String
name = InputBox("What is your Name Below:")
MsgBox "Hello, " & name & " Welcome to A++ Texteditor Ver1.0"
List1.AddItem "Times"
List1.AddItem "MS"
List1.AddItem "Arial"
List1.AddItem "Bookman Old Style"
List1.AddItem "Century"
List1.AddItem "Arial Black"
List1.AddItem "Century Gothic"
List1.AddItem "Impact"
List1.AddItem "Bookman Antiqua"
List1.AddItem "Comic Sans MS"
List1.AddItem "Fixedsys"
List1.AddItem "MS Serif"
List2.AddItem "8"
List2.AddItem "10"
List2.AddItem "12"
List2.AddItem "14"
List2.AddItem "16"
List2.AddItem "18"
List2.AddItem "20"
List2.AddItem "22"
List2.AddItem "24"
List2.AddItem "26"
List2.AddItem "28"
List2.AddItem "30"
List2.AddItem "42"
List2.AddItem "72"
Slider1.Value = 0
Let asd = 0
End Sub

Private Sub List1_Click()
If List1.ListIndex = 0 Then
Combo2.Text = "Times New Roman"
Else
End If
If List1.ListIndex = 1 Then
Combo2.Text = "MS"
Else
End If
If List1.ListIndex = 2 Then
Combo2.Text = "Arial"
Else
End If
If List1.ListIndex = 3 Then
Combo2.Text = "Bookman Old Style"
Else
End If
If List1.ListIndex = 4 Then
Combo2.Text = "Century"
Else
End If
If List1.ListIndex = 5 Then
Combo2.Text = "Arial Black"
Else
End If
If List1.ListIndex = 6 Then
Combo2.Text = "Century Gothic"
Else
End If
If List1.ListIndex = 7 Then
Combo2.Text = "Impact"
Else
End If
If List1.ListIndex = 8 Then
Combo2.Text = "Bookman Antiqua"
Else
End If
If List1.ListIndex = 9 Then
Combo2.Text = "Comic Sans MS"
Else
End If
If List1.ListIndex = 10 Then
Combo2.Text = "Fixedsys"
Else
End If
End Sub

Private Sub List2_Click()
If List2.ListIndex = 0 Then
RichTextBox1.SelFontSize = 8
Text1.FontSize = 8
Else
End If
If List2.ListIndex = 1 Then
RichTextBox1.SelFontSize = 10
Text1.FontSize = 10
Else
End If
If List2.ListIndex = 2 Then
RichTextBox1.SelFontSize = 12
Text1.FontSize = 12
Else
End If
If List2.ListIndex = 3 Then
RichTextBox1.SelFontSize = 14
Text1.FontSize = 14
Else
End If
If List2.ListIndex = 4 Then
RichTextBox1.SelFontSize = 16
Text1.FontSize = 16
Else
End If
If List2.ListIndex = 5 Then
RichTextBox1.SelFontSize = 18
Text1.FontSize = 18
Else
End If
If List2.ListIndex = 6 Then
RichTextBox1.SelFontSize = 20
Text1.FontSize = 20
Else
End If
If List2.ListIndex = 7 Then
RichTextBox1.SelFontSize = 22
Text1.FontSize = 22
Else
End If
If List2.ListIndex = 8 Then
RichTextBox1.SelFontSize = 24
Text1.FontSize = 24
Else
End If
If List2.ListIndex = 9 Then
RichTextBox1.SelFontSize = 26
Text1.FontSize = 26
Else
End If
If List2.ListIndex = 10 Then
RichTextBox1.SelFontSize = 28
Text1.FontSize = 28
Else
End If
If List2.ListIndex = 11 Then
RichTextBox1.SelFontSize = 30
Text1.FontSize = 30
Else
End If
If List2.ListIndex = 12 Then
RichTextBox1.SelFontSize = 42
Text1.FontSize = 42
Else
End If
If List2.ListIndex = 13 Then
RichTextBox1.SelFontSize = 72
Text1.FontSize = 72
Else
End If
End Sub


Download this snippet    Add to My Saved Code

Is a word processor capable of performing several functions apart from simple file handling or text Comments

No comments have been posted about Is a word processor capable of performing several functions apart from simple file handling or text. Why not be the first to post a comment about Is a word processor capable of performing several functions apart from simple file handling or text.

Post your comment

Subject:
Message:
0/1000 characters