VisualStyleElement.TextBox.TextEdit Класс
Определение
Предоставляет объекты VisualStyleElement для каждого состояния текстового поля.Provides VisualStyleElement objects for each state of a text box. Этот класс не наследуется.This class cannot be inherited.
public: ref class VisualStyleElement::TextBox::TextEdit abstract sealed
public static class VisualStyleElement.TextBox.TextEdit
type VisualStyleElement.TextBox.TextEdit = class
Public Class VisualStyleElement.TextBox.TextEdit
- Наследование
-
VisualStyleElement.TextBox.TextEdit
Примеры
В следующем примере кода показано, как создать объект VisualStyleRenderer с объектом, VisualStyleElement возвращаемым Disabled свойством.The following code example demonstrates how to create a VisualStyleRenderer with the VisualStyleElement returned by the Disabled property. Чтобы выполнить этот пример, вставьте его в форму Windows Forms.To run this example, paste it into a Windows Form. Обработайте Paint событие формы и вызовите DrawVisualStyleElementTextBoxTextEdit4
метод из Paint метода обработки событий, передав его e
как PaintEventArgs .Handle the form's Paint event and call the DrawVisualStyleElementTextBoxTextEdit4
method from the Paint event-handling method, passing e
as PaintEventArgs.
public void DrawVisualStyleElementTextBoxTextEdit4(PaintEventArgs e)
{
if (VisualStyleRenderer.IsElementDefined(
VisualStyleElement.TextBox.TextEdit.Disabled))
{
VisualStyleRenderer renderer =
new VisualStyleRenderer(VisualStyleElement.TextBox.TextEdit.Disabled);
Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
renderer.DrawBackground(e.Graphics, rectangle1);
e.Graphics.DrawString("VisualStyleElement.TextBox.TextEdit.Disabled",
this.Font, Brushes.Black, new Point(10, 10));
}
else
e.Graphics.DrawString("This element is not defined in the current visual style.",
this.Font, Brushes.Black, new Point(10, 10));
}
Public Sub DrawVisualStyleElementTextBoxTextEdit4(ByVal e As PaintEventArgs)
If (VisualStyleRenderer.IsElementDefined( _
VisualStyleElement.TextBox.TextEdit.Disabled)) Then
Dim renderer As New VisualStyleRenderer _
(VisualStyleElement.TextBox.TextEdit.Disabled)
Dim rectangle1 As New Rectangle(10, 50, 50, 50)
renderer.DrawBackground(e.Graphics, rectangle1)
e.Graphics.DrawString("VisualStyleElement.TextBox.TextEdit.Disabled", _
Me.Font, Brushes.Black, New Point(10, 10))
Else
e.Graphics.DrawString("This element is not defined in the current visual style.", _
Me.Font, Brushes.Black, New Point(10, 10))
End If
End Sub
Комментарии
Каждое свойство VisualStyleElement.TextBox.TextEdit класса возвращает, VisualStyleElement для другого состояния текстового поля.Each property of the VisualStyleElement.TextBox.TextEdit class returns a VisualStyleElement for a different state of a text box.
Свойства
Assist |
Возвращает элемент визуального стиля, представляющего текстовое поле в режиме помощника.Gets a visual style element that represents a text box in assist mode. |
Disabled |
Возвращает элемент визуального стиля, представляющего отключенное текстовое поле.Gets a visual style element that represents a disabled text box. |
Focused |
Возвращает элемент визуального стиля, представляющего текстовое поле, имеющее фокус.Gets a visual style element that represents a text box that has focus. |
Hot |
Возвращает элемент визуального стиля, представляющего активное текстовое поле.Gets a visual style element that represents a hot text box. |
Normal |
Возвращает элемент визуального стиля, представляющего текстовое поле в обычном состоянии.Gets a visual style element that represents a normal text box. |
ReadOnly |
Возвращает элемент визуального стиля, представляющего текстовое поле, доступное только для чтения.Gets a visual style element that represents a read-only text box. |
Selected |
Возвращает элемент визуального стиля, представляющего выбранное текстовое поле.Gets a visual style element that represents a selected text box. |