JJ: BAUSTELLE FormDesigner
This commit is contained in:
@@ -5,7 +5,7 @@ Public Class ClassControlCreator
|
||||
''' <summary>
|
||||
''' Konstanten
|
||||
''' </summary>
|
||||
Private Const LABEL_TEXT = "Bezeichnung definieren"
|
||||
Private Const DEFAULT_TEXT = "Bezeichnung definieren"
|
||||
|
||||
Private Const DEFAULT_FONT_SIZE As Integer = 10
|
||||
Private Const DEFAULT_FONT_FAMILY As String = "Arial"
|
||||
@@ -13,8 +13,15 @@ Public Class ClassControlCreator
|
||||
Private Const DEFAULT_COLOR As Integer = 0
|
||||
Private Const DEFAULT_WIDTH As Integer = 170
|
||||
Private Const DEFAULT_HEIGHT As Integer = 20
|
||||
Private Const DEFAULT_HEIGHT_TABLE As Integer = 150
|
||||
|
||||
Private Const PREFIX_TEXTBOX = "TXT"
|
||||
Private Const PREFIX_LABEL = "LBL"
|
||||
Private Const PREFIX_CHECKBOX = "CHK"
|
||||
Private Const PREFIX_COMBOBOX = "CMB"
|
||||
Private Const PREFIX_DATETIMEPICKER = "DTP"
|
||||
Private Const PREFIX_DATAGRIDVIEW = "DGV"
|
||||
Private Const PREFIX_TABLE = "TB"
|
||||
|
||||
''' <summary>
|
||||
''' Standard Eigenschaften für alle Controls
|
||||
@@ -75,7 +82,96 @@ Public Class ClassControlCreator
|
||||
}
|
||||
|
||||
Return control
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateNewLabel(location As Point) As Label
|
||||
Dim control As New Label With {
|
||||
.Name = $"{PREFIX_LABEL}_{clsTools.ShortGUID}",
|
||||
.Text = DEFAULT_TEXT,
|
||||
.AutoSize = True,
|
||||
.Location = location,
|
||||
.Cursor = Cursors.Hand
|
||||
}
|
||||
|
||||
Return control
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateNewCheckbox(location As Point) As CheckBox
|
||||
Dim control As New CheckBox With {
|
||||
.Name = $"{PREFIX_CHECKBOX}_{clsTools.ShortGUID}",
|
||||
.AutoSize = True,
|
||||
.Text = DEFAULT_TEXT,
|
||||
.Cursor = Cursors.Hand,
|
||||
.Location = location
|
||||
}
|
||||
|
||||
Return control
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateNewCombobox(location As Point) As ComboBox
|
||||
Dim control As New ComboBox With {
|
||||
.Name = $"{PREFIX_COMBOBOX}_{clsTools.ShortGUID}",
|
||||
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
|
||||
.Cursor = Cursors.Hand,
|
||||
.Location = location
|
||||
}
|
||||
|
||||
Return control
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateNewDatetimepicker(location As Point) As DateTimePicker
|
||||
Dim control As New DateTimePicker With {
|
||||
.Name = $"{PREFIX_DATETIMEPICKER}_{clsTools.ShortGUID}",
|
||||
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
|
||||
.Cursor = Cursors.Hand,
|
||||
.Location = location,
|
||||
.Format = DateTimePickerFormat.Short
|
||||
}
|
||||
|
||||
Return control
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateNewDatagridview(location As Point) As DataGridView
|
||||
Dim control As New DataGridView With {
|
||||
.Name = $"{PREFIX_DATAGRIDVIEW}_{clsTools.ShortGUID}",
|
||||
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT_TABLE),
|
||||
.Cursor = Cursors.Hand,
|
||||
.AllowUserToAddRows = False,
|
||||
.AllowUserToDeleteRows = False,
|
||||
.AllowUserToResizeColumns = False,
|
||||
.AllowUserToResizeRows = False
|
||||
}
|
||||
|
||||
control.Columns.Add(New DataGridViewTextBoxColumn With {
|
||||
.HeaderText = "",
|
||||
.Name = "column1"
|
||||
})
|
||||
|
||||
Return control
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateNewTable(location As Point) As DataGridView
|
||||
Dim control As New DataGridView With {
|
||||
.Name = $"{PREFIX_TABLE}_{clsTools.ShortGUID}",
|
||||
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT_TABLE),
|
||||
.Cursor = Cursors.Hand,
|
||||
.AllowUserToAddRows = False,
|
||||
.AllowUserToDeleteRows = False,
|
||||
.AllowUserToResizeColumns = False,
|
||||
.AllowUserToResizeRows = False
|
||||
}
|
||||
|
||||
control.Columns.Add(New DataGridViewTextBoxColumn With {
|
||||
.HeaderText = "Column1",
|
||||
.Name = "column1"
|
||||
})
|
||||
|
||||
control.Columns.Add(New DataGridViewTextBoxColumn With {
|
||||
.HeaderText = "Column2",
|
||||
.Name = "column2"
|
||||
})
|
||||
|
||||
Return control
|
||||
End Function
|
||||
|
||||
' ----------------------- EXISITING CONTROLS -----------------------
|
||||
|
||||
Reference in New Issue
Block a user