When designing a Form it is often useful to change the colors of some controls or the font of text controls on the Form.
Below is the Form "Phrase Header” from the Phrase XML project (you may wish to download this project).
PhraseXMLSetup.msi (397.00 kb)
In the sample below the color of the central panel has been set to “Blue”, and the font to “Pristina Size 14”.

Now it would be really useful if the end user was able to do this type of adjustment themselves!
This is one way to give the end user the ability to change both the color and font for any of the Forms controls.
1. A ContextMenuStrip is added to the property ContextMenuStrip of the Forms property sheet. It will detail the font and color changes you wish the user to decide upon. If the user presses the right hand mouse button the user will see your ContextMenuStrip:

2. If the user selects “Panel Color” the user will see:

3. Selecting the “Blue” color the user will see:

4. In Section 1 you can select “Change All Fonts”, you can similarly adjust the font to “Pristina Size 14”.
So lets examine what happens to the Visual Basic code.
All these functions and methods operate in the same way. If we examine how the user changes the color to "Blue".
When the user selects "Blue" from the Color menu in Section 2, this value is passed to a sub called color to PanelToolStriipMenuItem_Click.
The panel is named panel2.
Private Sub PanelToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ForeColourToolStripMenuItem.Click
PanelBack(1) = Me.Panel2
ReplaceColor.Show()
End Sub
We have a form called "ReplaceColor.vb" and a Class called "FontColor.vb"
Form "ReplaceColor.vb"
Imports System.Windows.Forms
Public Class ReplaceColor
Private Sub ReplaceColor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MyDialog As New ColorDialog()
MyDialog.AllowFullOpen = True
MyDialog.AnyColor = True
MyDialog.SolidColorOnly = False
MyDialog.ShowHelp = True
If (MyDialog.ShowDialog() = Windows.Forms.DialogResult.OK) Then
Me.BackColor = MyDialog.Color
ColorSelect = MyDialog.Color
num = Nothing
Do Until num > 20
If TypeOf PanelBack(num) Is System.Windows.Forms.Panel Then
ChangeControlBack(PanelBack(num), ColorSelect)
PanelBack(num) = Nothing
End If
num = num + 1
Loop
Me.Close()
End If
End Sub
End Class
Class "ColorFont.vb"
Imports System.Windows.Forms.ColorDialog
Module ColourFont
Public num As Integer
Public PanelBack(20) As Panel
Public FontSelect As Font
Public ColorSelect As Color
Public Function ChangeControlBack(ByVal MyPath As Control, ByVal myColor As Color) As Integer
MyPath.BackColor = myColor
ChangeControlBack = 1
End Function
End Module
Saving these settings
These application setting allow us to store and retrieve these property settings.
To find these settings look under My Project and then Settings:

These are set in the control properties:
