The document contains code for a form with a label. It defines click event handlers for different menu items that set the text alignment of the label to various positions (top left, top center, etc.) and set the text to "HERE". The code provides a way to dynamically position text in a label through menu selections.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
73 views
Exercise 10
The document contains code for a form with a label. It defines click event handlers for different menu items that set the text alignment of the label to various positions (top left, top center, etc.) and set the text to "HERE". The code provides a way to dynamically position text in a label through menu selections.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Public Class Form1
Private Sub TopLeftToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TopLeftToolStripMenuItem.Click Me.Label1.TextAlign = ContentAlignment.TopLeft Me.Label1.Text = "HERE" End Sub Private Sub TopMiddleToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TopMiddleToolStripMenuItem.Click Me.Label1.TextAlign = ContentAlignment.TopCenter Me.Label1.Text = "HERE" End Sub Private Sub TopRightToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TopRightToolStripMenuItem.Click Me.Label1.TextAlign = ContentAlignment.TopRight Me.Label1.Text = "HERE" End Sub Private Sub MiddleLeftToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MiddleLeftToolStripMenuItem.Click Me.Label1.TextAlign = ContentAlignment.MiddleLeft Me.Label1.Text = "HERE" End Sub Private Sub MiddleCenterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MiddleCenterToolStripMenuItem.Click Me.Label1.TextAlign = ContentAlignment.MiddleCenter Me.Label1.Text = "HERE" End Sub Private Sub MiddleRightToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MiddleRightToolStripMenuItem.Click Me.Label1.TextAlign = ContentAlignment.MiddleRight Me.Label1.Text = "HERE" End Sub Private Sub BottemLeftToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BottemLeftToolStripMenuItem.Click Me.Label1.TextAlign = ContentAlignment.BottomLeft Me.Label1.Text = "HERE" End Sub Private Sub BottemCenterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BottemCenterToolStripMenuItem.Click Me.Label1.TextAlign = ContentAlignment.BottomCenter Me.Label1.Text = "HERE" End Sub Private Sub BottomRightToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BottomRightToolStripMenuItem.Click Me.Label1.TextAlign = ContentAlignment.BottomRight Me.Label1.Text = "HERE" End Sub Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click