本文整理汇总了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