Hallo liebe Freunde,
ich steh bei einem Problem auf dem Schlauch.
Mit Option Strickt off funktioniert alles wie es soll, dennoch möchte ich gerne auf "on" stellen.
Es geht nur um diese Codeteile, wo ich nicht wirklich weiß, wie ich das richtig hinbekomme.
Zweck des Codes ist es mehrere Panels per Maus auf einer Form oder einem Panel zu verschieben.
Code und Fehlermeldungen anbei als Bildanhang.
Danke für Eure Hilfe und Tipps.
LG Roland
ich steh bei einem Problem auf dem Schlauch.
Mit Option Strickt off funktioniert alles wie es soll, dennoch möchte ich gerne auf "on" stellen.
Es geht nur um diese Codeteile, wo ich nicht wirklich weiß, wie ich das richtig hinbekomme.
Zweck des Codes ist es mehrere Panels per Maus auf einer Form oder einem Panel zu verschieben.
Code und Fehlermeldungen anbei als Bildanhang.
VB.NET-Quellcode
- Private PanelPos As Point
- 'Panel verschiebbar
- Private Sub Panel_Notiz_MouseDown(sender As Object, e As MouseEventArgs)
- If e.Button = Windows.Forms.MouseButtons.Left Then
- PanelPos = New Point(e.Location)
- End If
- End Sub
- 'Panel verschiebbar
- Private Sub Panel_Notiz_MouseMove(sender As Object, e As MouseEventArgs)
- Dim index As Integer = CInt(DirectCast(sender, Control).Tag)
- With Notiz(index).ProjektonsPanel
- .BringToFront()
- 'verschieben während linke Maustaste gedrückt
- If e.Button = Windows.Forms.MouseButtons.Left Then
- .Location = New Point(.Location + (e.Location - PanelPos))
- Exit Sub
- End If
- End With
- End Sub
- 'Panel verschiebbar
- Private Sub Panel_Notiz_MouseUp(sender As Object, e As MouseEventArgs)
- Dim index As Integer = CInt(DirectCast(sender, Control).Tag)
- If Notiz(index).ProjektonsPanel.Left < 16 Then Notiz(index).ProjektonsPanel.Left = 16
- If Notiz(index).ProjektonsPanel.Top < 90 Then Notiz(index).ProjektonsPanel.Top = 90
- If Notiz(index).ProjektonsPanel.Left > Panel_Spezial.Width - Notiz(index).ProjektonsPanel.Width - 22 Then Notiz(index).ProjektonsPanel.Left = Panel_Spezial.Width - Notiz(index).ProjektonsPanel.Width - 22
- If Notiz(index).ProjektonsPanel.Top > Panel_Spezial.Height - Notiz(index).ProjektonsPanel.Height - 22 Then Notiz(index).ProjektonsPanel.Top = Panel_Spezial.Height - Notiz(index).ProjektonsPanel.Height - 22
- Notiz(index).links = Notiz(index).ProjektonsPanel.Left
- Notiz(index).oben = Notiz(index).ProjektonsPanel.Top
- End Sub
Danke für Eure Hilfe und Tipps.
LG Roland
Liebe Grüße
Roland Berghöfer
Meine aktuellen und kostenlos verwendbaren Tools (mit VB.NET erstellt): freeremarkabletools.com | priconman.com | SimpleCalendar | AudibleTouch | BOComponent.com | bonit.at
Roland Berghöfer
Meine aktuellen und kostenlos verwendbaren Tools (mit VB.NET erstellt): freeremarkabletools.com | priconman.com | SimpleCalendar | AudibleTouch | BOComponent.com | bonit.at