Exercice Visual Basic : Mini Word
Rédigé par GC Team, Publié le 07 Janvier 2012, Mise à jour le Samedi, 17 Décembre 2022 16:23![](/images/thumb/146/default.png)
Participez au vote ☆☆☆☆☆★★★★★
Ecrire le programme qui permet de réaliser l'interface suivante:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
Public Class Form1 Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click TextBox1.Text = String.Empty TextBox2.Text = String.Empty TextBox1.Focus() End Sub Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click Me.Close() End Sub Private Sub UndoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UndoToolStripMenuItem.Click If TypeOf Me.ActiveControl Is TextBox Then CType(Me.ActiveControl, TextBox).Undo() End If End Sub Private Sub CutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CutToolStripMenuItem.Click If TypeOf Me.ActiveControl Is TextBox Then CType(Me.ActiveControl, TextBox).Cut() End If End Sub Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click If TypeOf Me.ActiveControl Is TextBox Then CType(Me.ActiveControl, TextBox).Copy() End If End Sub Private Sub PasteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasteToolStripMenuItem.Click If TypeOf Me.ActiveControl Is TextBox Then CType(Me.ActiveControl, TextBox).Paste() End If End Sub Private Sub SelectAllToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SelectAllToolStripMenuItem.Click If TypeOf Me.ActiveControl Is TextBox Then CType(Me.ActiveControl, TextBox).SelectAll() End If End Sub Private Sub MainToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MainToolStripMenuItem.Click If MainToolStripMenuItem.Checked Then ToolStrip1.Visible = True Else ToolStrip1.Visible = False End If End Sub Private Sub FormattingToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FormattingToolStripMenuItem.Click If MainToolStripMenuItem.Checked Then ToolStrip2.Visible = True Else ToolStrip2.Visible = False End If End Sub Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click CType(Me.ActiveControl, TextBox).Undo() End Sub Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click CType(Me.ActiveControl, TextBox).Cut() End Sub Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click CType(Me.ActiveControl, TextBox).Copy() End Sub Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click CType(Me.ActiveControl, TextBox).Paste() End Sub Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click TextBox1.Text = String.Empty TextBox2.Text = String.Empty TextBox1.Focus() End Sub End Class |