Set ColorDialog properties : ColorDialog « GUI « VB.Net Tutorial






Set ColorDialog properties
Imports System.Drawing
Imports System.Windows.Forms

public class ColorDialogProperty
   public Shared Sub Main
        Dim ColorDialog1 As ColorDialog = New System.Windows.Forms.ColorDialog
        Dim objSelectedColor As Color
        'Dim aryColors() As Integer = {222663, 35453, 7888}
        Dim aryColors() As Integer = {Math.Abs(Color.Gray.ToArgb), _
              Math.Abs(Color.Navy.ToArgb), _
              Math.Abs(Color.Teal.ToArgb)}

        With ColorDialog1
            .Color = Color.Blue
            '.AllowFullOpen = False
            .FullOpen = True
            .AnyColor = True
            .CustomColors = aryColors
            .SolidColorOnly = True
        End With

        If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            Console.WriteLine(ColorDialog1.Color)
        End If

   End Sub
End class








14.67.ColorDialog
14.67.1.Set ColorDialog propertiesSet ColorDialog properties
14.67.2.ColorDialog: Named Color or R G B valueColorDialog: Named Color or R G B value
14.67.3.Use Color Dialog to set ColorUse Color Dialog to set Color
14.67.4.Color Dialog with custom color settings