Dim df As Integer Dim nf As Integer Dim v As Integer Dim fs As String Dim col As Integer
Private Sub Blink_Click()
col = 1 Picture1.Visible = True Timer1.Enabled = True Timer1.Interval = 200 End Sub Private Sub Bullet_Click() RichTextBox1.SelBullet = True End Sub Private Sub Close_Click() If df = 0 Then GoTo dirty v = MsgBox("This text has been modified. Save Changes", vbYesNoCancel, "Close") If v = 6 Then Call Save_Click If v = 2 Then GoTo Naught dirty: RichTextBox1.Text = "" df = 0 Form1.Caption = "" Naught: End Sub
Private Sub Col_Fun_Click()
Timer2.Enabled = True col = 1 Timer2.Interval = 20 End Sub Private Sub Colour_Click() CommonDialog1.Flags = 1 CommonDialog1.ShowColor If CommonDialog1.CancelError Then GoTo crp1 RichTextBox1.SelColor = CommonDialog1.Color crp1: End Sub Private Sub Copy_Click() Clipboard.SetText (RichTextBox1.SelText) End Sub Private Sub Cut_Click() Clipboard.SetText (RichTextBox1.SelText) RichTextBox1.SelText = "" End Sub Private Sub Exit_Click() Call Close_Click End End Sub Private Sub Font_Click() CommonDialog1.Flags = 1 CommonDialog1.ShowFont If CommonDialog1.CancelError Then GoTo crp RichTextBox1.SelFontName = CommonDialog1.FontName RichTextBox1.SelBold = CommonDialog1.FontBold RichTextBox1.SelItalic = CommonDialog1.FontItalic RichTextBox1.SelUnderline = CommonDialog1.FontUnderline RichTextBox1.SelFontSize = CommonDialog1.FontSize crp: End Sub
Private Sub Form_Load()
Form1.Caption = "Untitled.txt" RichTextBox1.Text = "" nf = 1 End Sub Private Sub Indent_Click() RichTextBox1.SelIndent = 100 * InputBox("Enter width", "Indent") End Sub Private Sub New_Click() Call Close_Click RichTextBox1.Text = "" df = 0 Form1.Caption = "Untitled.txt" nf = 1 End Sub Private Sub Open_Click() nf = 0 CommonDialog1.ShowOpen fn = CommonDialog1.FileName If CommonDialog1.CancelError Then GoTo ex Call Close_Click RichTextBox1.LoadFile CommonDialog1.FileName df = 0 Form1.Caption = CommonDialog1.FileTitle nf = 0 ex: End Sub Private Sub Paste_Click() RichTextBox1.SelText = Clipboard.GetText End Sub Private Sub Picture1_Click() End Sub Private Sub RichTextBox1_Change() df = 1 End Sub Private Sub Save_As_Click() CommonDialog1.ShowSave fn = CommonDialog1.FileName If CommonDialog1.CancelError Then GoTo ex1 RichTextBox1.SaveFile fn, 0 RichTextBox1.LoadFile fn Form1.Caption = CommonDialog1.FileTitle df = 0 nf = 0 ex1: End Sub Private Sub Save_Click() If nf = 1 Then Call Save_As_Click End If RichTextBox1.SaveFile fn RichTextBox1.LoadFile fn df = 0 End Sub Private Sub Select_All_Click() RichTextBox1.SelStart = 0 RichTextBox1.SelLength = Len(RichTextBox1.Text) End Sub Private Sub Timer1_Timer() If col <> 4 Then GoTo skip col = 1 skip: Picture1.Picture = ImageList1.ListImages(col Mod 4).Picture col = col + 1 End Sub