SystemColors Classe
Definição
Cada propriedade da classe SystemColors é uma estrutura Color que é a cor de um elemento de exibição do Windows.Each property of the SystemColors class is a Color structure that is the color of a Windows display element.
public ref class SystemColors abstract sealed
public ref class SystemColors sealed
public static class SystemColors
public sealed class SystemColors
type SystemColors = class
Public Class SystemColors
Public NotInheritable Class SystemColors
- Herança
-
SystemColors
Exemplos
O exemplo de código a seguir demonstra o Equality operador e a SystemColors classe.The following code example demonstrates the Equality operator and the SystemColors class. Este exemplo foi projetado para ser usado com um formulário do Windows que contém um botão chamado Button1 .This example is designed to be used with a Windows Form that contains a button named Button1. Cole o código a seguir em seu formulário e associe o Button1_Click método ao evento do botão Click .Paste the following code into your form and associate the Button1_Click method with the button's Click event.
void Button1_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
if ( this->BackColor == SystemColors::ControlDark )
{
this->BackColor = SystemColors::Control;
}
}
private void Button1_Click(System.Object sender, System.EventArgs e)
{
if (this.BackColor == SystemColors.ControlDark)
{
this.BackColor = SystemColors.Control;
}
}
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
If (Color.op_Equality(Me.BackColor, SystemColors.ControlDark)) Then
Me.BackColor = SystemColors.Control
End If
End Sub
Comentários
Melhor desempenho é obtido usando as propriedades das SystemPens SystemBrushes classes ou em vez de criar uma nova caneta ou pincel com base em um valor de SystemColors .Better performance is achieved by using the properties of the SystemPens or SystemBrushes classes rather than creating a new pen or brush based on a value from SystemColors. Por exemplo, se você quisesse obter um pincel para a cor de face de um elemento 3D, use a SystemBrushes.Control propriedade porque ela obtém um pincel que já existe, ao passo que chamar o SolidBrush Construtor com um valor de parâmetro de SystemColors.Control criará um novo pincel.For example, if you wanted to get a brush for the face color of a 3-D element, use the SystemBrushes.Control property because it gets a brush that already exists, whereas calling the SolidBrush constructor with a parameter value of SystemColors.Control will create a new brush.
Propriedades
| ActiveBorder |
Obtém uma estrutura Color que tem a cor da borda da janela ativa.Gets a Color structure that is the color of the active window's border. |
| ActiveCaption |
Obtém uma estrutura Color que é a cor da tela de fundo da barra de título da janela ativa.Gets a Color structure that is the color of the background of the active window's title bar. |
| ActiveCaptionText |
Obtém uma estrutura Color que é a cor do texto na barra de título da janela ativa.Gets a Color structure that is the color of the text in the active window's title bar. |
| AppWorkspace |
Obtém uma estrutura Color que é a cor do workspace do aplicativo.Gets a Color structure that is the color of the application workspace. |
| ButtonFace |
Obtém uma estrutura Color que é a cor de um elemento 3D.Gets a Color structure that is the face color of a 3-D element. |
| ButtonHighlight |
Obtém uma estrutura Color que é a cor de realce de um elemento 3D.Gets a Color structure that is the highlight color of a 3-D element. |
| ButtonShadow |
Obtém uma estrutura Color que é a cor de sombra de um elemento 3D.Gets a Color structure that is the shadow color of a 3-D element. |
| Control |
Obtém uma estrutura Color que é a cor de um elemento 3D.Gets a Color structure that is the face color of a 3-D element. |
| ControlDark |
Obtém uma estrutura Color que é a cor de sombra de um elemento 3D.Gets a Color structure that is the shadow color of a 3-D element. |
| ControlDarkDark |
Obtém uma estrutura Color que é a cor de sombra escura de um elemento 3D.Gets a Color structure that is the dark shadow color of a 3-D element. |
| ControlLight |
Obtém uma estrutura Color que é a cor clara de um elemento 3D.Gets a Color structure that is the light color of a 3-D element. |
| ControlLightLight |
Obtém uma estrutura Color que é a cor de realce de um elemento 3D.Gets a Color structure that is the highlight color of a 3-D element. |
| ControlText |
Obtém uma estrutura Color que é a cor do texto em um elemento 3D.Gets a Color structure that is the color of text in a 3-D element. |
| Desktop |
Obtém uma estrutura Color que é a cor da área de trabalho.Gets a Color structure that is the color of the desktop. |
| GradientActiveCaption |
Obtém uma estrutura Color que é a cor mais clara no gradiente de cores da barra de título de uma janela ativa.Gets a Color structure that is the lightest color in the color gradient of an active window's title bar. |
| GradientInactiveCaption |
Obtém uma estrutura Color que é a cor mais clara no gradiente de cores da barra de título de uma janela inativa.Gets a Color structure that is the lightest color in the color gradient of an inactive window's title bar. |
| GrayText |
Obtém uma estrutura Color que é a cor do texto esmaecido.Gets a Color structure that is the color of dimmed text. |
| Highlight |
Obtém uma estrutura Color que é a cor de tela de fundo dos itens selecionados.Gets a Color structure that is the color of the background of selected items. |
| HighlightText |
Obtém uma estrutura Color que é a cor do texto dos itens selecionados.Gets a Color structure that is the color of the text of selected items. |
| HotTrack |
Obtém uma estrutura Color que é a cor usada para designar um item com rastreio importante.Gets a Color structure that is the color used to designate a hot-tracked item. |
| InactiveBorder |
Obtém uma estrutura Color que tem a cor da borda da janela inativa.Gets a Color structure that is the color of an inactive window's border. |
| InactiveCaption |
Obtém uma estrutura Color que é a cor da tela de fundo da barra de título da janela inativa.Gets a Color structure that is the color of the background of an inactive window's title bar. |
| InactiveCaptionText |
Obtém uma estrutura Color que é a cor do texto na barra de título da janela inativa.Gets a Color structure that is the color of the text in an inactive window's title bar. |
| Info |
Obtém uma estrutura Color que é a cor de tela de fundo de uma dica de ferramenta.Gets a Color structure that is the color of the background of a ToolTip. |
| InfoText |
Obtém uma estrutura Color que é a cor do texto de uma dica de ferramenta.Gets a Color structure that is the color of the text of a ToolTip. |
| Menu |
Obtém uma estrutura Color que é a cor da tela de fundo do menu.Gets a Color structure that is the color of a menu's background. |
| MenuBar |
Obtém uma estrutura Color que é a cor de tela de fundo de uma barra de menus.Gets a Color structure that is the color of the background of a menu bar. |
| MenuHighlight |
Obtém uma estrutura Color que é a cor usada para realçar itens de menu quando o menu é exibido como um menu simples.Gets a Color structure that is the color used to highlight menu items when the menu appears as a flat menu. |
| MenuText |
Obtém uma estrutura Color que é a cor de um texto de menu.Gets a Color structure that is the color of a menu's text. |
| ScrollBar |
Obtém uma estrutura Color que é a cor de tela de fundo de uma barra de rolagem.Gets a Color structure that is the color of the background of a scroll bar. |
| Window |
Obtém uma estrutura Color que é a cor da tela de fundo na área de cliente de uma janela.Gets a Color structure that is the color of the background in the client area of a window. |
| WindowFrame |
Obtém uma estrutura Color que é a cor de um quadro de janela.Gets a Color structure that is the color of a window frame. |
| WindowText |
Obtém uma estrutura Color que é a cor do texto na área de cliente de uma janela.Gets a Color structure that is the color of the text in the client area of a window. |