Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class PenOptionsDialog
Inherits System.Windows.Forms.Form
#Region "Controls"
Dim lblPenWidth As New Label With _
{.Parent = Me, .Width = 60, .Text = "Width: ", .Top = 10}
Dim WithEvents cboPenWidth As New ComboBox With {.Parent = Me, .Top = 10}
Dim lblPenColor As New Label With _
{.Parent = Me, .Width = 60, .Text = "Color: ", .Top = 50}
Dim WithEvents cboPenColor As New ComboBox With {.Parent = Me, .Top = 50}
Dim lblPenStyle As New Label With _
{.Parent = Me, .Width = 60, .Text = "Style: ", .Top = 90}
Dim WithEvents cboPenStyle As New ComboBox With {.Parent = Me, .Top = 90}
Dim lblPenAlignment As New Label With _
{.Parent = Me, .Width = 60, .Text = "Alignment: ", .Top = 130}
Dim WithEvents cboPenAlignment As New ComboBox With {.Parent = Me, .Top = _
130}
Dim WithEvents btnOK As New Button With _
{.Parent = Me, .Top = 180, .Width = 60, .Text = "&OK", _
.DialogResult = Windows.Forms.DialogResult.OK}
Dim WithEvents btnCancel As New Button With _
{.Parent = Me, .Top = 180, .Width = 60, .Text = "&Cancel", _
.Left = 70, .DialogResult = Windows.Forms.DialogResult.Cancel}
#End Region
#Region "Properties"
''' <summary>Array mit benannten Farben für die Auswahl</summary>
Public WriteOnly Property Options_Color() As Drawing.Color()
Set(value As Color())
value = (From c As Color In value Distinct).ToArray
With cboPenColor.Items
.Clear()
For i As Integer = 0 To value.Length - 1
.Add(value(i).Name)
Next i%
End With
cboPenColor.SelectedIndex = 0
End Set
End Property
Dim _pen As Pen = Nothing
''' <summary>Abfragen/Festlegen der ausgewählten Eigenschaften</summary>
Public Property Options_Pen As Pen
Get
Return _pen
End Get
Set(value As Pen)
_pen = value
End Set
End Property
#End Region
Private Sub InitializeComponent()
Me.SuspendLayout()
Me.Name = "PenOptionsDialog"
Me.ResumeLayout(False)
End Sub
Beitrag wurde zuletzt am 02.11.14 um 06:35:01 editiert. |