本文整理匯總了VB.NET中System.Windows.Forms.ColorDialog.CustomColors屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET ColorDialog.CustomColors屬性的具體用法?VB.NET ColorDialog.CustomColors怎麽用?VB.NET ColorDialog.CustomColors使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Windows.Forms.ColorDialog
的用法示例。
在下文中一共展示了ColorDialog.CustomColors屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: ColorDialog
Dim MyDialog = New ColorDialog()
' Allows the user to select or edit a custom color.
MyDialog.AllowFullOpen = True
' Assigns an array of custom colors to the CustomColors property.
MyDialog.CustomColors = New Integer() {6916092, 15195440, 16107657, 1836924, _
3758726, 12566463, 7526079, 7405793, 6945974, 241502, 2296476, 5130294, _
3102017, 7324121, 14993507, 11730944}
' Allows the user to get help. (The default is false.)
MyDialog.ShowHelp = True
' Sets the initial color select to the current text color,
' so that if the user cancels out, the original color is restored.
MyDialog.Color = Me.BackColor
MyDialog.ShowDialog()
Me.BackColor = MyDialog.Color
示例2: ColorDialogWithCustomColorSettings
' 導入命名空間
Imports System.IO
Imports System.Windows.Forms
public class ColorDialogWithCustomColorSettings
public Shared Sub Main
Dim ColorDB As New ColorDialog()
ColorDB.CustomColors = New Integer() _
{&HFF00FF, &HFF0000, &HF0F0F0, &HF0F0F0, _
&HAAAAAA, &HBBBBBB, &HCCCCCC, &HDDDDDD, _
&HEEEEEE, &HAAA0A0, &HBBB0B0, &HCCC0C0, _
&HDDD0D0, &H111111, &H333333, &H888888}
If (ColorDB.ShowDialog() = DialogResult.OK) Then
Console.WriteLine(ColorDB.Color)
End If
End Sub
End class