語言

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 過去是 Picker 視窗的子板。

initialColor
String

初始顏色需在選取視窗中顯示,並以有效的 HTML 色彩格式呈現。

傳回

顏色值以 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)的色碼。

適用於