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
|