Exclamationlabel objects?

Posts 1–8 of 8 · Page 1 of 1
label objects?
Using context menu, i want to be able to right click and add a label and name the label what ever i want and be able to move it where i want. is this posible? if so please explain. thanks in advance!
You can add items to the contextmenustrip programatically.

[highlight="VB.Net"]ContextMenuStrip.Items.Add("Bla bla bla")[/highlight]

Now use the appropriate event and insert an appropriate object rather than just "Bla bla bla" as string. It has further options - use intellisense.
Quote Originally Posted by Blubb1337 View Post
You can add items to the contextmenustrip programatically.

[highlight="VB.Net"]ContextMenuStrip.Items.Add("Bla bla bla")[/highlight]

Now use the appropriate event and insert an appropriate object rather than just "Bla bla bla" as string. It has further options - use intellisense.
I think he wants a function that when he clicks in a contextmenustrpit's button a new label will appear and he should be able to rename it...
[highlight="VB.Net"] Dim lbl As New Label With {.Text = "Blaaa", .Location = New Point(5, 5)}

Me.Controls.Add(lbl)[/highlight]
On Right Click event:
[highlight=VB.Net]Dim txt = InputBox("Label text:", "Add a label")
Dim newLbl As New Label With {.Text=txt, .Location = New Point(MousePosition.X,MousePosition.Y)}
Me.Controls.Add(newLbl)
[/highlight]
thanks so much guys

Quote Originally Posted by Lyoto Machida View Post
On Right Click event:
[highlight=VB.Net]Dim txt = InputBox("Label text:", "Add a label")
Dim newLbl As New Label With {.Text=txt, .Location = New Point(MousePosition.X,MousePosition.Y)}
Me.Controls.Add(newLbl)
[/highlight]
seems to not display the label for some reason....
Quote Originally Posted by asdf12345678 View Post
thanks so much guys



seems to not display the label for some reason....
CHange the MousePosition.X and etc..
To a location inside the form
Quote Originally Posted by Lyoto Machida View Post


CHange the MousePosition.X and etc..
To a location inside the form
i cant have it to where it can be placed where i right clicked?
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?