This documentation is archived and is not being maintained.

ColorBuilder.BuildColor Method

Starts a color editor to build an HTML color property value.

[Visual Basic]
Public Shared Function BuildColor( _
   ByVal component As IComponent, _
   ByVal owner As Control, _
   ByVal initialColor As String _
) As String
[C#]
public static string BuildColor(
 IComponent component,
 Control owner,
 string initialColor
);
[C++]
public: static String* BuildColor(
 IComponent* component,
 Control* owner,
 String* initialColor
);
[JScript]
public static function BuildColor(
   component : IComponent,
 owner : Control,
 initialColor : String
) : String;

Parameters

component
The IComponent whose site is to be used to access design-time services.
owner
The Control used to parent the picker window.
initialColor
The initial color to be shown in the picker window, in a valid HTML color format.

Return Value

The color value, represented as a string in an HTML color format, or a null reference (Nothing in Visual Basic) if the builder service could not be retrieved.

Remarks

The returned string, if other than a null reference (Nothing in Visual Basic), indicates a color in a valid HTML color format. Valid formats include named colors and color codes in RGB format (#RRGGBB).

Example

[Visual Basic] 
' 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")

[C#] 
// 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");          

[C++] 
// 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 (S"RRGGBB") color String*.
System::Web::UI::Design::ColorBuilder::BuildColor(this->Component, c, S"405599");

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

ColorBuilder Class | ColorBuilder Members | System.Web.UI.Design Namespace

Show: