ColorBuilder.BuildColor(IComponent, Control, String) 方法

定义

启动颜色编辑器以生成 HTML 颜色属性值。

public:
 static System::String ^ BuildColor(System::ComponentModel::IComponent ^ component, System::Windows::Forms::Control ^ owner, System::String ^ initialColor);
public static string BuildColor (System.ComponentModel.IComponent component, System.Windows.Forms.Control owner, string initialColor);
static member BuildColor : System.ComponentModel.IComponent * System.Windows.Forms.Control * string -> string
Public Shared Function BuildColor (component As IComponent, owner As Control, initialColor As String) As String

参数

component
IComponent

将使用其站点来访问设计时服务的 IComponent

owner
Control

用作选择器窗口的父级的 Control

initialColor
String

将在选择器窗口中显示的初始颜色,为有效的 HTML 颜色格式。

返回

String

表示为 HTML 颜色格式字符串的颜色值,或者如果未能检索到生成器服务,则为 null

示例

// Create a parent control.
System::Windows::Forms::Control^ c = gcnew System::Windows::Forms::Control;
c->CreateControl();

// Launch the Color Builder using the specified control
// parent and an initial HTML format (S"RRGGBB") color String*.
System::Web::UI::Design::ColorBuilder::BuildColor( this->Component, c, "405599" );
// Create a parent control.
System.Windows.Forms.Control c = new System.Windows.Forms.Control();            
c.CreateControl();            

// Launch the Color Builder using the specified control 
// parent and an initial HTML format ("RRGGBB") color string.
System.Web.UI.Design.ColorBuilder.BuildColor(this.Component, c, "405599");
' Create a parent control.
Dim c As New System.Windows.Forms.Control()
c.CreateControl()

' Launch the Color Builder using the specified control 
' parent and an initial HTML format ("RRGGBB") color string.
System.Web.UI.Design.ColorBuilder.BuildColor(Me.Component, c, "405599")

注解

返回的字符串(如果除其他 null)指示采用有效 HTML 颜色格式的颜色。 有效格式包括 RGB 格式 (#RRGGBB) 的命名颜色和颜色代码。

适用于