How to Adjust the Font in a Menu for Enlightenment
- 1). Start Microsoft Visual Basic Express; click "New Project..." on the left pane of your screen; then select "Windows Forms Application." Click "OK."
- 2). Double-click "MenuStrip1" to add a menu strip control. Click "Type Here" on the menu strip control and type "File." Click next to "File" and type "Options."
- 3). Double-click "File" to open the "Form1.vb"module. Press "Ctrl" and "A" then "Delete" to remove all existing code.
- 4). Copy and paste the code below into your "Form1.vb" module:
Public Class Form1
Private Sub FileToolStripMenuItem_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileToolStripMenuItem.MouseEnter
Me.MenuStrip1.Items(0).Font = New Font("Georgia", 16)
End Sub
Private Sub FileToolStripMenuItem_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileToolStripMenuItem.MouseLeave
Me.MenuStrip1.Items(0).Font = New Font("Segoe UI", 9)
End Sub
Private Sub OptionsToolStripMenuItem_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles OptionsToolStripMenuItem.MouseEnter
Me.MenuStrip1.Items(1).Font = New Font("Georgia", 16)
End Sub
Private Sub OptionsToolStripMenuItem_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles OptionsToolStripMenuItem.MouseLeave
Me.MenuStrip1.Items(1).Font = New Font("Segoe UI", 9)
End Sub
End Class - 5). Press "F5" to run your program then move your mouse over the menu strip to see the font changes.