Results 1 to 5 of 5

Thread: [RESOLVED] How raise event mouse click to the void(blank space) of listview

  1. #1

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Resolved [RESOLVED] How raise event mouse click to the void(blank space) of listview

    I want when i right click to void(black space) of listview the contextmenu will show.
    How i do that ? I only did with click to item oF listview.
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: How raise event mouse click to the void(blank space) of listview

    You don't have to do anything. Just assign a ContextMenuStrip to the ContextMenuStrip property of the ListView and the menu will be displayed no matter where you right-click.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: How raise event mouse click to the void(blank space) of listview

    Sorry, but i have 2 contextmenustrip. The first is for right clicking to items and i want the second is for right clicking to empty space of listview.

    How can i do that.
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: How raise event mouse click to the void(blank space) of listview

    May I recommend that, in future, you provide the full story up front. Only with all the information can we provide informed advice.

    Handle the MouseClick event, which provides coordinates. You can then use the GetItemAt or HitTest method to determine whether those coordinates are on an item or not.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: How raise event mouse click to the void(blank space) of listview

    ok. Thanks you
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

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