jj 16.03 hints
This commit is contained in:
@@ -10,8 +10,9 @@ Public Class ClassControlBuilder
|
||||
Private _mouse_move_handler As MouseEventHandler
|
||||
Private _mouse_click_handler As EventHandler
|
||||
Private _group_box_drag_drop_handler As DragEventHandler
|
||||
Private _tool_tip As ToolTip
|
||||
Private _tool_tip_handler As EventHandler
|
||||
Private _onRecordChangedName As String = "OnRecordChanged"
|
||||
Private _onMouseHoverName As String = "OnMouseHover"
|
||||
Private _events As System.ComponentModel.EventHandlerList = Nothing
|
||||
|
||||
Protected ReadOnly Property Events() As System.ComponentModel.EventHandlerList
|
||||
@@ -38,6 +39,20 @@ Public Class ClassControlBuilder
|
||||
End RaiseEvent
|
||||
End Event
|
||||
|
||||
Public Custom Event OnMouseHover As EventHandler
|
||||
AddHandler(value As EventHandler)
|
||||
Me.Events.AddHandler(_onMouseHoverName, value)
|
||||
End AddHandler
|
||||
|
||||
RemoveHandler(value As EventHandler)
|
||||
Me.Events.RemoveHandler(_onMouseHoverName, value)
|
||||
End RemoveHandler
|
||||
|
||||
RaiseEvent(sender As Object, e As EventArgs)
|
||||
CType(Me.Events(_onMouseHoverName), EventHandler).Invoke(sender, e)
|
||||
End RaiseEvent
|
||||
End Event
|
||||
|
||||
' ==================================================================================
|
||||
' Handler für alle Controls
|
||||
' ==================================================================================
|
||||
@@ -58,6 +73,15 @@ Public Class ClassControlBuilder
|
||||
onRecordChangedHandler.Invoke(sender, e)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub MouseHover(sender As Object, e As EventArgs)
|
||||
Dim onMouseHoverHandler As EventHandler = CType(Me.Events(_onMouseHoverName), EventHandler)
|
||||
|
||||
If onMouseHoverHandler IsNot Nothing Then
|
||||
onMouseHoverHandler.Invoke(sender, e)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub OnTextBoxFocus(sender As Object, ByVal e As EventArgs)
|
||||
Dim box As TextBox = sender
|
||||
box.BackColor = Color.LemonChiffon
|
||||
@@ -187,6 +211,9 @@ Public Class ClassControlBuilder
|
||||
Dim type As String = control.GetType().Name
|
||||
Dim eventArgs As New System.EventArgs
|
||||
|
||||
' Hover Handler gilt für alle Controls
|
||||
AddHandler control.MouseHover, AddressOf MouseHover
|
||||
|
||||
Select Case type
|
||||
Case "TextBox"
|
||||
Dim textbox As TextBox = CType(control, TextBox)
|
||||
@@ -228,47 +255,6 @@ Public Class ClassControlBuilder
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
'Private Function GetAllItems(dgv As DataGridView) As List(Of String)
|
||||
' Dim list As New List(Of String)
|
||||
|
||||
' For Each row As DataGridViewRow In dgv.Rows
|
||||
' Dim cell As DataGridViewCell = row.Cells(0)
|
||||
' If Not IsNothing(cell.Value) Then
|
||||
' list.Add(cell.Value)
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' Return list
|
||||
'End Function
|
||||
|
||||
'Private Sub SaveAllItems(controlId As Integer, items As String)
|
||||
' Try
|
||||
' Dim SQL As String = String.Format("UPDATE TBPMO_CONTROL SET STATIC_LIST='{0}' WHERE GUID = {1}", items, controlId)
|
||||
' ClassDatabase.Execute_non_Query(SQL)
|
||||
' Catch ex As Exception
|
||||
' MsgBox("Error in SaveAllItems:" & vbNewLine & ex.Message)
|
||||
' End Try
|
||||
'End Sub
|
||||
|
||||
'Private Sub UserDeletingRow(ByVal sender As Object, ByVal e As DataGridViewRowCancelEventArgs)
|
||||
' Dim dgv As DataGridView = DirectCast(sender, DataGridView)
|
||||
' Dim id As Integer = DirectCast(dgv.Tag, ClassControlMetadata).Id
|
||||
' Dim list As List(Of String) = GetAllItems(dgv)
|
||||
' list.RemoveAt(e.Row.Index)
|
||||
' Dim items As String = String.Join(";", list.ToArray())
|
||||
|
||||
' SaveAllItems(id, items)
|
||||
'End Sub
|
||||
|
||||
'Private Sub CellEndEdit(ByVal sender As Object, e As DataGridViewCellEventArgs)
|
||||
' Dim dgv As DataGridView = DirectCast(sender, DataGridView)
|
||||
' Dim id As Integer = DirectCast(dgv.Tag, ClassControlMetadata).Id
|
||||
' Dim list As List(Of String) = GetAllItems(dgv)
|
||||
' Dim items As String = String.Join(";", list.ToArray())
|
||||
|
||||
' SaveAllItems(id, items)
|
||||
'End Sub
|
||||
|
||||
Private Sub SetDragDropHandler(groupbox As GroupBox)
|
||||
If Not IsNothing(_group_box_drag_drop_handler) Then
|
||||
AddHandler groupbox.DragDrop, Me._group_box_drag_drop_handler
|
||||
@@ -378,8 +364,7 @@ Public Class ClassControlBuilder
|
||||
MouseUpHandler As MouseEventHandler,
|
||||
MouseMoveHandler As MouseEventHandler,
|
||||
MouseClickHandler As EventHandler,
|
||||
GroupBoxDragDropHandler As DragEventHandler,
|
||||
ToolTipControl As ToolTip)
|
||||
GroupBoxDragDropHandler As DragEventHandler)
|
||||
|
||||
Me._master_panel = MasterPanel
|
||||
Me._mouse_down_handler = MouseDownHandler
|
||||
@@ -387,14 +372,10 @@ Public Class ClassControlBuilder
|
||||
Me._mouse_move_handler = MouseMoveHandler
|
||||
Me._mouse_click_handler = MouseClickHandler
|
||||
Me._group_box_drag_drop_handler = GroupBoxDragDropHandler
|
||||
|
||||
Me._tool_tip = ToolTipControl
|
||||
End Sub
|
||||
|
||||
Public Sub New(MasterPanel As Panel,
|
||||
ToolTipControl As ToolTip)
|
||||
Public Sub New(MasterPanel As Panel)
|
||||
Me._master_panel = MasterPanel
|
||||
Me._tool_tip = ToolTipControl
|
||||
End Sub
|
||||
|
||||
' +++ Public Properties +++
|
||||
@@ -1399,8 +1380,6 @@ Public Class ClassControlBuilder
|
||||
control.TabStop = False
|
||||
control.Image = My.Resources.add1
|
||||
|
||||
_tool_tip.SetToolTip(control, text)
|
||||
|
||||
If _new And IsNothing(parent) Then
|
||||
control.Location = Me.GetCursorPosition()
|
||||
control.Size = defaultSize
|
||||
|
||||
Reference in New Issue
Block a user