S
Steve
Hi All
I have a windows forms vb.net 2005 application
I have a form with buttons representing restaurant tables
To allow the user to join Tables at certain times I use drag and drop
When the user drags a button on to another, the one being dragged is made
invisible and the one dropped on to gets wider and has the seating capacity
increased
When loading the form the tables are created in code from left to right,
then next row from left to right
e.g 1 2 3 4 etc
All works well when dragging from higher number table to lower table (i.e
from right to left). The join works great
When I drag a lower number table to a higher number table the dragdrop event
doesn't fire
I have noticed when dragging from right to left, the dragged button passes
behind the button being dropped on whereas dragging left to right the
dragged button passes over the button being dropped on
Maybe it is a z-order issue I am not sure
Any help appreciated
Regards
Steve
code to load buttons.............
btn = New Button
btn.Name = CStr(dr("pbname"))
btn.Tag = dr
If Not dr("joined") OrElse dr("joinmaster") Then
btn.Visible = True
Else
btn.Visible = False
End If
btn.Left = CInt(dr("pbleft"))
btn.Top = CInt(dr("pbtop"))
If Not IsDBNull(dr("pbheight")) Then
btn.Height = CInt(dr("pbheight"))
End If
If Not IsDBNull(dr("pbwidth")) Then
btn.Width = CInt(dr("pbwidth"))
End If
btn.Font = New Font(btn.Font.FontFamily, btn.Font.Size, FontStyle.Bold)
btn.AllowDrop = True
btn.AllowFocus = False
btn.BringToFront()
AddHandler btn.MouseDown, AddressOf btn_Mousedown
AddHandler btn.MouseUp, AddressOf btn_mouseUp
AddHandler btn.MouseMove, AddressOf btn_MouseMove
AddHandler btn.MouseEnter, AddressOf btn_MouseEnter
AddHandler btn.MouseLeave, AddressOf btn_MouseLeave
AddHandler btn.Click, AddressOf btn_click
AddHandler btn.DragDrop, AddressOf btn_DragDrop
AddHandler btn.DragEnter, AddressOf btnDragEnter
pnlTables.Controls.Add(btn)
I have a windows forms vb.net 2005 application
I have a form with buttons representing restaurant tables
To allow the user to join Tables at certain times I use drag and drop
When the user drags a button on to another, the one being dragged is made
invisible and the one dropped on to gets wider and has the seating capacity
increased
When loading the form the tables are created in code from left to right,
then next row from left to right
e.g 1 2 3 4 etc
All works well when dragging from higher number table to lower table (i.e
from right to left). The join works great
When I drag a lower number table to a higher number table the dragdrop event
doesn't fire
I have noticed when dragging from right to left, the dragged button passes
behind the button being dropped on whereas dragging left to right the
dragged button passes over the button being dropped on
Maybe it is a z-order issue I am not sure
Any help appreciated
Regards
Steve
code to load buttons.............
btn = New Button
btn.Name = CStr(dr("pbname"))
btn.Tag = dr
If Not dr("joined") OrElse dr("joinmaster") Then
btn.Visible = True
Else
btn.Visible = False
End If
btn.Left = CInt(dr("pbleft"))
btn.Top = CInt(dr("pbtop"))
If Not IsDBNull(dr("pbheight")) Then
btn.Height = CInt(dr("pbheight"))
End If
If Not IsDBNull(dr("pbwidth")) Then
btn.Width = CInt(dr("pbwidth"))
End If
btn.Font = New Font(btn.Font.FontFamily, btn.Font.Size, FontStyle.Bold)
btn.AllowDrop = True
btn.AllowFocus = False
btn.BringToFront()
AddHandler btn.MouseDown, AddressOf btn_Mousedown
AddHandler btn.MouseUp, AddressOf btn_mouseUp
AddHandler btn.MouseMove, AddressOf btn_MouseMove
AddHandler btn.MouseEnter, AddressOf btn_MouseEnter
AddHandler btn.MouseLeave, AddressOf btn_MouseLeave
AddHandler btn.Click, AddressOf btn_click
AddHandler btn.DragDrop, AddressOf btn_DragDrop
AddHandler btn.DragEnter, AddressOf btnDragEnter
pnlTables.Controls.Add(btn)