Color.Name Property
.NET Framework 3.0
Gets the name of this Color.
Namespace: System.Drawing
Assembly: System.Drawing (in system.drawing.dll)
Assembly: System.Drawing (in system.drawing.dll)
The following code example demonstrates how to use the Name property. This example is designed to be used with Windows Forms. Paste the code into a form that contains a button named Button2 and associate the Button2_Click method with the button's Click event.
private: void Button2_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ ) { Button2->Width = 100; Button2->Text = String::Format( "Color: {0}", Button2->BackColor.Name ); }
private void button2_Click(Object sender, System.EventArgs e)
{
button2.set_Width(100);
button2.set_Text("Color: " + button2.get_BackColor().get_Name());
} //button2_Click
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: