SystemPens Classe
Definição
Cada propriedade da classe SystemPens é uma Pen que é a cor de um elemento de exibição do Windows e tem uma largura de 1 pixel.Each property of the SystemPens class is a Pen that is the color of a Windows display element and that has a width of 1 pixel.
public ref class SystemPens abstract sealed
public ref class SystemPens sealed
public static class SystemPens
public sealed class SystemPens
type SystemPens = class
Public Class SystemPens
Public NotInheritable Class SystemPens
- Herança
-
SystemPens
Exemplos
O exemplo de código a seguir cria pontos e tamanhos usando vários operadores sobrecarregados definidos para esses tipos.The following code example creates points and sizes using several of the overloaded operators defined for these types. Ele também demonstra como usar a SystemPens classe.It also demonstrates how to use the SystemPens class.
Este exemplo foi projetado para ser usado com Windows Forms.This example is designed to be used with Windows Forms. Crie um formulário que contenha um Button nome subtractButton .Create a form that contains a Button named subtractButton. Cole o código no formulário e chame o CreatePointsAndSizes método do método de manipulação de Paint eventos do formulário, passando e como PaintEventArgs .Paste the code into the form and call the CreatePointsAndSizes method from the form's Paint event-handling method, passing e as PaintEventArgs.
void CreatePointsAndSizes( PaintEventArgs^ e )
{
// Create the starting point.
Point startPoint = Point(subtractButton->Size);
// Use the addition operator to get the end point.
Point endPoint = startPoint + System::Drawing::Size( 140, 150 );
// Draw a line between the points.
e->Graphics->DrawLine( SystemPens::Highlight, startPoint, endPoint );
// Convert the starting point to a size and compare it to the
// subtractButton size.
System::Drawing::Size buttonSize = (System::Drawing::Size)startPoint;
if ( buttonSize == subtractButton->Size )
{
e->Graphics->DrawString( "The sizes are equal.", gcnew System::Drawing::Font( this->Font,FontStyle::Italic ), Brushes::Indigo, 10.0F, 65.0F );
}
}
private void CreatePointsAndSizes(PaintEventArgs e)
{
// Create the starting point.
Point startPoint = new Point(subtractButton.Size);
// Use the addition operator to get the end point.
Point endPoint = startPoint + new Size(140, 150);
// Draw a line between the points.
e.Graphics.DrawLine(SystemPens.Highlight, startPoint, endPoint);
// Convert the starting point to a size and compare it to the
// subtractButton size.
Size buttonSize = (Size)startPoint;
if (buttonSize == subtractButton.Size)
// If the sizes are equal, tell the user.
{
e.Graphics.DrawString("The sizes are equal.",
new Font(this.Font, FontStyle.Italic),
Brushes.Indigo, 10.0F, 65.0F);
}
}
Private Sub CreatePointsAndSizes(ByVal e As PaintEventArgs)
' Create the starting point.
Dim startPoint As New Point(subtractButton.Size)
' Use the addition operator to get the end point.
Dim endPoint As Point = Point.op_Addition(startPoint, _
New Size(140, 150))
' Draw a line between the points.
e.Graphics.DrawLine(SystemPens.Highlight, startPoint, endPoint)
' Convert the starting point to a size and compare it to the
' subtractButton size.
Dim buttonSize As Size = Point.op_Explicit(startPoint)
If (Size.op_Equality(buttonSize, subtractButton.Size)) Then
' If the sizes are equal, tell the user.
e.Graphics.DrawString("The sizes are equal.", _
New Font(Me.Font, FontStyle.Italic), _
Brushes.Indigo, 10.0F, 65.0F)
End If
End Sub
Propriedades
| ActiveBorder |
Obtém um Pen que é a cor da borda da janela ativa.Gets a Pen that is the color of the active window's border. |
| ActiveCaption |
Obtém um Pen que é a cor da tela de fundo da barra de título da janela ativa.Gets a Pen that is the color of the background of the active window's title bar. |
| ActiveCaptionText |
Obtém um Pen que é a cor do texto na barra de título da janela ativa.Gets a Pen that is the color of the text in the active window's title bar. |
| AppWorkspace |
Obtém um Pen que é a cor do workspace do aplicativo.Gets a Pen that is the color of the application workspace. |
| ButtonFace |
Obtém um Pen que é a cor de um elemento 3D.Gets a Pen that is the face color of a 3-D element. |
| ButtonHighlight |
Obtém um Pen que é a cor de realce de um elemento 3D.Gets a Pen that is the highlight color of a 3-D element. |
| ButtonShadow |
Obtém um Pen que é a cor de sombra de um elemento 3D.Gets a Pen that is the shadow color of a 3-D element. |
| Control |
Obtém um Pen que é a cor de um elemento 3D.Gets a Pen that is the face color of a 3-D element. |
| ControlDark |
Obtém um Pen que é a cor de sombra de um elemento 3D.Gets a Pen that is the shadow color of a 3-D element. |
| ControlDarkDark |
Obtém um Pen que é a cor de sombra escura de um elemento 3D.Gets a Pen that is the dark shadow color of a 3-D element. |
| ControlLight |
Obtém um Pen que é a cor clara de um elemento 3D.Gets a Pen that is the light color of a 3-D element. |
| ControlLightLight |
Obtém um Pen que é a cor de realce de um elemento 3D.Gets a Pen that is the highlight color of a 3-D element. |
| ControlText |
Obtém um Pen que é a cor do texto em um elemento 3D.Gets a Pen that is the color of text in a 3-D element. |
| Desktop |
Obtém um Pen que é a cor da área de trabalho do Windows.Gets a Pen that is the color of the Windows desktop. |
| GradientActiveCaption |
Obtém um Pen que é a cor mais clara no gradiente de cores da barra de título de uma janela ativa.Gets a Pen that is the lightest color in the color gradient of an active window's title bar. |
| GradientInactiveCaption |
Obtém um Pen que é a cor mais clara no gradiente de cores da barra de título de uma janela inativa.Gets a Pen that is the lightest color in the color gradient of an inactive window's title bar. |
| GrayText |
Obtém um Pen que é a cor do texto esmaecido.Gets a Pen that is the color of dimmed text. |
| Highlight |
Obtém um Pen que é a cor de tela de fundo dos itens selecionados.Gets a Pen that is the color of the background of selected items. |
| HighlightText |
Obtém um Pen que é a cor do texto dos itens selecionados.Gets a Pen that is the color of the text of selected items. |
| HotTrack |
Obtém um Pen que é a cor usada para designar um item com rastreio importante.Gets a Pen that is the color used to designate a hot-tracked item. |
| InactiveBorder |
Obtém um Pen que é a cor da borda de uma janela inativa.Gets a Pen is the color of the border of an inactive window. |
| InactiveCaption |
Obtém um Pen que é a cor da legenda de barra de título de uma janela inativa.Gets a Pen that is the color of the title bar caption of an inactive window. |
| InactiveCaptionText |
Obtém um Pen que é a cor do texto em uma barra de título de uma janela inativa.Gets a Pen that is the color of the text in an inactive window's title bar. |
| Info |
Obtém um Pen que é a cor da tela de fundo de uma dica de ferramenta.Gets a Pen that is the color of the background of a ToolTip. |
| InfoText |
Obtém um Pen que é a cor do texto de uma dica de ferramenta.Gets a Pen that is the color of the text of a ToolTip. |
| Menu |
Obtém um Pen que é a cor da tela de fundo do menu.Gets a Pen that is the color of a menu's background. |
| MenuBar |
Obtém um Pen que é a cor da tela de fundo de uma barra de menus.Gets a Pen that is the color of the background of a menu bar. |
| MenuHighlight |
Obtém um Pen que é a cor usada para realçar itens de menu quando o menu é exibido como um menu simples.Gets a Pen that is the color used to highlight menu items when the menu appears as a flat menu. |
| MenuText |
Obtém um Pen que é a cor do texto do menu.Gets a Pen that is the color of a menu's text. |
| ScrollBar |
Obtém um Pen que é a cor da tela de fundo de uma barra de rolagem.Gets a Pen that is the color of the background of a scroll bar. |
| Window |
Obtém um Pen que é a cor da tela de fundo na área de cliente de uma janela.Gets a Pen that is the color of the background in the client area of a window. |
| WindowFrame |
Obtém um Pen que é a cor de um quadro de janela.Gets a Pen that is the color of a window frame. |
| WindowText |
Obtém um Pen que é a cor do texto na área de cliente de uma janela.Gets a Pen that is the color of the text in the client area of a window. |
Métodos
| FromSystemColor(Color) |
Cria um Pen do Color especificado.Creates a Pen from the specified Color. |