Hallo Leute,
ich stehe heute mal wieder etwas auf dem Schlauch...
Ich möchte eine zur Laufzeit erstellte und mit der Maus aktivierten TextBox so wie in der IDE darstellen. Dieses funktioniert auch soweit.
Meine Vorlage war:
http://dotnet-snippets.de/dns/vbnet-...ed-SID605.aspx
Mein Problem ist jetzt, wenn ich die Shift- Taste drücke, möchte ich eine Mehrfachauswahl erreichen
Meine Auswahl erfolgt in etwa so.
Wobei die Steuerelemente in einer For Next Schleife an die Funktion
übergeben werden. Hiebei wird jedoch dann immer nur das letzte Element
aktiviert. Wie ist dies zu realisieren?
Vielen Dank.
Gruß
Tabes
ich stehe heute mal wieder etwas auf dem Schlauch...
Ich möchte eine zur Laufzeit erstellte und mit der Maus aktivierten TextBox so wie in der IDE darstellen. Dieses funktioniert auch soweit.
Meine Vorlage war:
http://dotnet-snippets.de/dns/vbnet-...ed-SID605.aspx
Mein Problem ist jetzt, wenn ich die Shift- Taste drücke, möchte ich eine Mehrfachauswahl erreichen
Meine Auswahl erfolgt in etwa so.
VB.NET-Quellcode
- Public Sub Select_Control(ByRef objControl As Control, Optional ByVal Multiple_Selection As Boolean = False)
- If Multiple_Selection = False Then
- If InResizeMode = True Or MoveControl = True Then Exit Sub
- End If
- meControl = objControl
- meGraphics = meControl.CreateGraphics()
- With meGraphics
- 'Rahmen
- .DrawRectangle(Pens.Gray, New Rectangle(meControl.Location.X - (GrabSize / 2), meControl.Location.Y - (GrabSize / 2), _
- meControl.Width + GrabSize, meControl.Height + GrabSize))
- End With
- 'Positionen für die GrabRects in der Reihenfolge:
- 'TopLeft, TopMiddle, TopRight, MiddleLeft, MiddleRight, BottomLeft,BottomMiddle,BottomRight
- Dim GrabRectPos() As Point = { _
- New Point(meControl.Location.X - GrabSize, meControl.Location.Y - GrabSize), _
- New Point(meControl.Location.X + (meControl.Width / 2) - (GrabSize / 2), meControl.Location.Y - GrabSize), _
- New Point(meControl.Location.X + meControl.Width, meControl.Location.Y - GrabSize), _
- New Point(meControl.Location.X - GrabSize, meControl.Location.Y + (meControl.Height / 2) - (GrabSize / 2)), _
- New Point(meControl.Location.X + (meControl.Width), meControl.Location.Y + (meControl.Height / 2) - (GrabSize / 2)), _
- New Point(meControl.Location.X - GrabSize, meControl.Location.Y + (meControl.Height)), _
- New Point(meControl.Location.X + (meControl.Width / 2) - (GrabSize / 2), meControl.Location.Y + (meControl.Height)), _
- New Point(meControl.Location.X + meControl.Width, meControl.Location.Y + (meControl.Height))}
- For i = LBound(GrabRects) To UBound(GrabRects)
- GrabRects(i).Location = GrabRectPos(i)
- GrabRects(i).Size = New Size(GrabSize, GrabSize)
- GrabRects(i).BackColor = GrabRectColor
- GrabRects(i).Parent = meParent
- GrabRects(i).Visible = True
- Next
- meForm.Refresh()
- End Sub
Wobei die Steuerelemente in einer For Next Schleife an die Funktion
übergeben werden. Hiebei wird jedoch dann immer nur das letzte Element
aktiviert. Wie ist dies zu realisieren?
Vielen Dank.
Gruß
Tabes