This documentation is archived and is not being maintained.

IWebFormsBuilderUIService.BuildColor Method

Starts a ColorBuilder to build a color property.

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

Parameters

owner
The control used to parent the dialog shown by the ColorBuilder.
initialColor
The initial color for the editor to pre-select.

Return Value

The color that was selected. This value will be a named color, or an RGB color expressed in HTML color format (#RRGGBB).

Remarks

The initialColor parameter should be a named color, or an RGB color expressed in HTML color format (#RRGGBB).

Example

[Visual Basic] 
' Obtain an instance of an IWebFormsBuilderUIService.
Dim builderService As IWebFormsBuilderUIService = _
    CType(Me.Component.Site.GetService(GetType(IWebFormsBuilderUIService)), _
    IWebFormsBuilderUIService)

' Return from method if the service was not obtained.            
If builderService Is Nothing Then
    Return
End If
' Create a parent control.
Dim c As New System.Windows.Forms.Control()
c.CreateControl()

' Start the color builder using the specified control 
' parent and an initial HTML format ("RRGGBB") color string.
builderService.BuildColor(c, "405599")

[C#] 
// Obtain an instance of an IWebFormsBuilderUIService.
IWebFormsBuilderUIService builderService =                 (IWebFormsBuilderUIService)this.Component.Site.GetService(
    typeof(IWebFormsBuilderUIService));

// Return from method if the service was not obtained.            
if( builderService == null )
    return;

// Create a parent control.
System.Windows.Forms.Control c = new System.Windows.Forms.Control();            
c.CreateControl();            

// Start the color builder using the specified control 
// parent and an initial HTML format ("RRGGBB") color string.
builderService.BuildColor(c, "405599");            

[C++] 
// Obtain an instance of an IWebFormsBuilderUIService.
IWebFormsBuilderUIService* builderService =
   dynamic_cast<IWebFormsBuilderUIService*>(this->Component->Site->GetService(__typeof(IWebFormsBuilderUIService)));

// Return from method if the service was not obtained.
if (builderService == 0)
   return;

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

// Start the color builder using the specified control
// parent and an initial HTML format (S"RRGGBB") color string.
builderService->BuildColor(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

IWebFormsBuilderUIService Interface | IWebFormsBuilderUIService Members | System.Web.UI.Design Namespace

Show: