Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class FontColorandStyle
- Private Sub FontColorandStyle_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- End Sub
- Private Sub ChangeFontColor(ByVal col As Color)
- For Each ctrl As Control In Me.Controls
- If TypeOf (ctrl) Is Label Then
- ctrl.ForeColor = col
- End If
- Next
- End Sub
- Private Sub ChangeBackColor(ByVal col As Color)
- For Each ctrl As Control In Me.Controls
- If TypeOf (ctrl) Is Label Then
- ctrl.BackColor = col
- End If
- Next
- End Sub
- Private Sub ChangeFontStyle()
- For Each ctrl As Control In Me.Controls
- If TypeOf (ctrl) Is Label Then
- 'ctrl.Font = New Font(ctrl.Font.FontFamily, ctrl.Font.Size, ctrl.Font.Style Xor FontStyle.Regular)
- ctrl.Font = New Font("verdana", 30, FontStyle.Underline)
- End If
- Next
- End Sub
- Private Sub MsubRed_Click(sender As Object, e As EventArgs) Handles MsubRed.Click
- Call ChangeFontColor(Color.Red)
- End Sub
- Private Sub MsubGreen_Click(sender As Object, e As EventArgs) Handles MsubGreen.Click
- Call ChangeFontColor(Color.Green)
- End Sub
- Private Sub MsubBlue_Click(sender As Object, e As EventArgs) Handles MsubBlue.Click
- Call ChangeFontColor(Color.Blue)
- End Sub
- Private Sub MsubGray_Click(sender As Object, e As EventArgs) Handles MsubGray.Click
- Call ChangeFontColor(Color.Gray)
- End Sub
- Private Sub MsubPink_Click(sender As Object, e As EventArgs) Handles MsubPink.Click
- Call ChangeFontColor(Color.Pink)
- End Sub
- Private Sub MsubYellow_Click(sender As Object, e As EventArgs) Handles MsubYellow.Click
- Call ChangeFontColor(Color.Yellow)
- End Sub
- Private Sub MsubBrown_Click(sender As Object, e As EventArgs) Handles MsubBrown.Click
- Call ChangeFontColor(Color.Brown)
- End Sub
- Private Sub FontStyleToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FontStyleToolStripMenuItem.Click
- Call ChangeFontStyle()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement