Listview with Contextmenustrip...

  • Thread starter Thread starter Co
  • Start date Start date
C

Co

Hi All,

I have been trying to find some example code for the use of a
contextmenustrip with a Listview\
but all the things I found didn't exactly do what I wanted.
Hopefully someone can help me out here.

I have a Listview on my form. In the Listview I show records from a
database.
Now I want a pulldownmenu when I right-click on one of the Listview
items.
So far no problem,

but now I don't want the contextmenustrip to come up when I click
on the Listview where there is no item displayed.
Also I need to retrieve the field "Id" from the item which was
highlighted when I right-clicked.

So I think I need to give the Listview item a reference number
corresponding with the field " Id" of my
database table when the items are loaded into the Listview.

Marco
 
Co said:
Hi All,

I have been trying to find some example code for the use of a
contextmenustrip with a Listview\
but all the things I found didn't exactly do what I wanted.
Hopefully someone can help me out here.

I have a Listview on my form. In the Listview I show records from a
database.
Now I want a pulldownmenu when I right-click on one of the Listview
items.
So far no problem,

but now I don't want the contextmenustrip to come up when I click
on the Listview where there is no item displayed.
Also I need to retrieve the field "Id" from the item which was
highlighted when I right-clicked.

So I think I need to give the Listview item a reference number
corresponding with the field " Id" of my
database table when the items are loaded into the Listview.

Marco

Marco,

What about the code I gave you do you not understand?

LS
 
Marco,

    What about the code I gave you do you not understand?

LS

Lloyd,

No I didn't understand.
I tried the code and it said "Label" or "0".
I need a little bit more.
I'm just a newbie, sorry

Marco
 
Back
Top