Results 1 to 4 of 4

Thread: Contextmenu

  1. #1

    Thread Starter
    Hyperactive Member phrozeman's Avatar
    Join Date
    Apr 2000
    Location
    Netherlands
    Posts
    442

    Contextmenu

    VB Code:
    1. Private Sub lblFull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lblFull.MouseDown
    2.         lblFull.ForeColor = Color.Orange
    3.         Me.PopMe.Show(Me, New Point(e.X, e.Y))
    4.     End Sub

    When i Press lblFull my menu will popup on the top of the form, but i need it to popup on the point i pressed the label...

    How can i do that?
    There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me

  2. #2
    Hyperactive Member stingrae's Avatar
    Join Date
    Apr 2002
    Location
    Sydney
    Posts
    401
    here's one way:

    Code:
            Dim mnu As New ContextMenu()
            mnu = NameOfContextMenu
            mnu.Show(Me, lblFull.Location)
    this will make it popup at the location of the label.
    "The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.

    Windows & Web Developer
    Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
    Sutherland Shire, Sydney Australia
    www.stingrae.com.au
    Developer of Arnold - Gym & Martial Arts Database Management System
    www.gymdatabase.com.au

  3. #3

    Thread Starter
    Hyperactive Member phrozeman's Avatar
    Join Date
    Apr 2000
    Location
    Netherlands
    Posts
    442
    Thanks Stingrae, exactly what i needed
    There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    I am just learning VB.net (ok so i started about ten minutes ago)

    and trying to figure out the popup menu....looked at this thread

    one problem...the popup menu does not pupop at the cursor?

    but this worked


    VB Code:
    1. Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
    2.         Dim mnu As New ContextMenu
    3.         mnu = ContextMenu1
    4.         mnu.Show(Me, New Point(e.X + Button1.Left, e.Y + Button1.Top))
    5.  
    6.  End Sub

    would this be right? or is there a better way?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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