Thread: label objects?

Results 1 to 8 of 8
  1. #1
    asdf12345678's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    95
    Reputation
    10
    Thanks
    15
    My Mood
    Drunk

    Exclamation 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!

    Help me raise my Habamon!


    best hacks here!!!














    ----♥♥-♥♥---- Put This
    ---♥♥---♥♥--- In Your
    ---♥♥---♥♥--- Sig If
    ---♥♥---♥♥--- You Know
    ----♥♥-♥♥---- Someone
    -----♥♥♥----- Who Died Or Is Suffering
    ----♥♥-♥♥----from
    ---♥♥---♥♥--- Cancer.
    www.bulletformyvalentine.com got there!

  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    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.



  3. #3
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,114
    Reputation
    1096
    Thanks
    1,971
    My Mood
    Doh
    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...

  4. #4
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    [highlight="VB.Net"] Dim lbl As New Label With {.Text = "Blaaa", .Location = New Point(5, 5)}

    Me.Controls.Add(lbl)[/highlight]



  5. The Following User Says Thank You to Blubb1337 For This Useful Post:

    asdf12345678 (06-20-2011)

  6. #5
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    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]

  7. The Following User Says Thank You to Lyoto Machida For This Useful Post:

    asdf12345678 (06-20-2011)

  8. #6
    asdf12345678's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    95
    Reputation
    10
    Thanks
    15
    My Mood
    Drunk
    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....
    Last edited by asdf12345678; 06-19-2011 at 09:37 PM.

    Help me raise my Habamon!


    best hacks here!!!














    ----♥♥-♥♥---- Put This
    ---♥♥---♥♥--- In Your
    ---♥♥---♥♥--- Sig If
    ---♥♥---♥♥--- You Know
    ----♥♥-♥♥---- Someone
    -----♥♥♥----- Who Died Or Is Suffering
    ----♥♥-♥♥----from
    ---♥♥---♥♥--- Cancer.
    www.bulletformyvalentine.com got there!

  9. #7
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    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

  10. #8
    asdf12345678's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    95
    Reputation
    10
    Thanks
    15
    My Mood
    Drunk
    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?

    Help me raise my Habamon!


    best hacks here!!!














    ----♥♥-♥♥---- Put This
    ---♥♥---♥♥--- In Your
    ---♥♥---♥♥--- Sig If
    ---♥♥---♥♥--- You Know
    ----♥♥-♥♥---- Someone
    -----♥♥♥----- Who Died Or Is Suffering
    ----♥♥-♥♥----from
    ---♥♥---♥♥--- Cancer.
    www.bulletformyvalentine.com got there!