Results 1 to 3 of 3

Thread: [RESOLVED] Add Label At Mouse Position

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    426

    Resolved [RESOLVED] Add Label At Mouse Position

    I am trying to add a label just where my mouse is using a context menu "Add Label" but it goes to a different position. How can i do this. Below is my code.
    VB Code:
    1. Private Sub cmnuAddLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmnuAddLabel.Click
    2.         Dim lbl As Label
    3.         lbl = New Label
    4.         lbl.Text = "My Lable"
    5.         AddHandler lbl.MouseDown, AddressOf MyEventHandler
    6.         lbl.Location = New System.Drawing.Point(Control.MousePosition.X, Control.MousePosition.Y)
    7.         Me.Controls.Add(lbl)
    8.     End Sub
    Last edited by maps; Aug 25th, 2006 at 04:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width