MS_07122015
This commit is contained in:
@@ -102,75 +102,80 @@
|
||||
#Region "+++++ Drag Drop Funktionen +++++"
|
||||
|
||||
Public Sub ControlDragDrop(type As String, Parent As GroupBox)
|
||||
Dim r As New System.Random()
|
||||
Dim def_font_family As String = DefaultFont.Name
|
||||
Dim def_font_color As Integer = DefaultForeColor.ToArgb
|
||||
Dim def_font_style As Integer = 0
|
||||
Dim def_font_size As Integer = 8
|
||||
Try
|
||||
Dim r As New System.Random()
|
||||
Dim def_font_family As String = DefaultFont.Name
|
||||
Dim def_font_color As Integer = DefaultForeColor.ToArgb
|
||||
Dim def_font_style As Integer = 0
|
||||
Dim def_font_size As Integer = 8
|
||||
|
||||
Dim random As Integer = r.Next(8, 100)
|
||||
Select Case type
|
||||
Case "lbl"
|
||||
CtrlBuilder.AddLabel("lbl" & random, "Bezeichnung definieren", 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, "", True, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "txt"
|
||||
CtrlBuilder.AddTextBox("txt" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, False, False, "String", True, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "cmb"
|
||||
CtrlBuilder.AddComboBox("cmb" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, "String", True, False, "", "", Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "dtp"
|
||||
CtrlBuilder.AddDateTimePicker("dtp" & random, 0, 0, def_font_family, def_font_size, def_font_style, 0, False, 0, 0, False, True, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "dgv"
|
||||
CtrlBuilder.AddDataGridView("dgv" & random, 0, 0, 0, 0, True, False, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "chk"
|
||||
CtrlBuilder.AddCheckBox("chk" & random, "Bezeichn. defnieren", False, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, False, 0, 0, True, False, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "rb"
|
||||
CtrlBuilder.AddRadioButton("rb" & random, "Bezeichn. defnieren", False, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, False, 0, 0, True, False, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "pb"
|
||||
CtrlBuilder.AddPictureBox("pb" & random, 0, 0, 0, 0, True, False, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "gb"
|
||||
CtrlBuilder.AddGroupBox("gb" & random, "Bezeichn. defnieren", 0, 0, 0, 0, ColorToInt(SystemColors.Control), def_font_color, def_font_family, def_font_size, def_font_style, True, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "f_addappointment"
|
||||
CtrlBuilder.FunctionAddAppointment("f_addappointment" & random, "Zu Kalender hinzufügen", 0, 0, 0, 0, True, Parent)
|
||||
Dim random As Integer = r.Next(8, 100)
|
||||
Select Case type
|
||||
Case "lbl"
|
||||
CtrlBuilder.AddLabel("lbl" & random, "Bezeichnung definieren", 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, "", True, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "txt"
|
||||
CtrlBuilder.AddTextBox("txt" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, False, False, "String", True, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "cmb"
|
||||
CtrlBuilder.AddComboBox("cmb" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, "String", True, False, "", "", Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "dtp"
|
||||
CtrlBuilder.AddDateTimePicker("dtp" & random, 0, 0, def_font_family, def_font_size, def_font_style, 0, False, 0, 0, False, True, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "dgv"
|
||||
CtrlBuilder.AddDataGridView("dgv" & random, 0, 0, 0, 0, True, False, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "chk"
|
||||
CtrlBuilder.AddCheckBox("chk" & random, "Bezeichn. defnieren", False, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, False, 0, 0, True, False, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "rb"
|
||||
CtrlBuilder.AddRadioButton("rb" & random, "Bezeichn. defnieren", False, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, False, 0, 0, True, False, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "pb"
|
||||
CtrlBuilder.AddPictureBox("pb" & random, 0, 0, 0, 0, True, False, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "gb"
|
||||
CtrlBuilder.AddGroupBox("gb" & random, "Bezeichn. defnieren", 0, 0, 0, 0, ColorToInt(SystemColors.Control), def_font_color, def_font_family, def_font_size, def_font_style, True, Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "f_addappointment"
|
||||
CtrlBuilder.FunctionAddAppointment("f_addappointment" & random, "Zu Kalender hinzufügen", 0, 0, 0, 0, True, Parent)
|
||||
|
||||
If ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) = True Then
|
||||
Dim ControlId = GetControlID_for_Name(CtrlBuilder.CurrentControl.Name, CURRENT_FORM_ID)
|
||||
ClassFunctionCommands.InsertFunction(ControlId, "ADDAPPOINTMENT")
|
||||
End If
|
||||
Case "f_addformdata"
|
||||
CtrlBuilder.FunctionAddFormData("f_addformdata" & random, "Add form Data", 0, 0, 0, 0, True, Parent)
|
||||
If ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) = True Then
|
||||
Dim ControlId = GetControlID_for_Name(CtrlBuilder.CurrentControl.Name, CURRENT_FORM_ID)
|
||||
ClassFunctionCommands.InsertFunction(ControlId, "ADDAPPOINTMENT")
|
||||
End If
|
||||
Case "f_addformdata"
|
||||
CtrlBuilder.FunctionAddFormData("f_addformdata" & random, "Add form Data", 0, 0, 0, 0, True, Parent)
|
||||
|
||||
If ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) = True Then
|
||||
Dim ControlId = GetControlID_for_Name(CtrlBuilder.CurrentControl.Name, CURRENT_FORM_ID)
|
||||
ClassFunctionCommands.InsertFunction(ControlId, "ADDFORMDATA")
|
||||
End If
|
||||
Case "lstbxcheck"
|
||||
CtrlBuilder.AddCheckedListBox("chlb" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, True, False, "", "", Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "lstbx"
|
||||
CtrlBuilder.AddListBox("lbx" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, True, False, "", "", Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case Else
|
||||
MsgBox("Event '" & type & "' nicht definiert")
|
||||
End Select
|
||||
If ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) = True Then
|
||||
Dim ControlId = GetControlID_for_Name(CtrlBuilder.CurrentControl.Name, CURRENT_FORM_ID)
|
||||
ClassFunctionCommands.InsertFunction(ControlId, "ADDFORMDATA")
|
||||
End If
|
||||
Case "lstbxcheck"
|
||||
CtrlBuilder.AddCheckedListBox("chlb" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, True, False, "", "", Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case "lstbx"
|
||||
CtrlBuilder.AddListBox("lbx" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, True, False, "", "", Parent)
|
||||
' Aktuelles Control in die Datenbank speichern
|
||||
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
|
||||
Case Else
|
||||
MsgBox("Event '" & type & "' nicht definiert")
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
MsgBox("unexpected Error in ControlDragDrop: " & vbNewLine, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Groupbox_DragDrop(sender As Object, e As DragEventArgs)
|
||||
|
||||
Reference in New Issue
Block a user