Click here to Skip to main content
15,915,789 members
Home / Discussions / C#
   

C#

 
Questionget xml data Pin
arkiboys25-Apr-07 4:59
arkiboys25-Apr-07 4:59 
AnswerRe: get xml data Pin
kubben25-Apr-07 5:35
kubben25-Apr-07 5:35 
GeneralRe: get xml data Pin
arkiboys25-Apr-07 5:37
arkiboys25-Apr-07 5:37 
GeneralRe: get xml data Pin
kubben25-Apr-07 5:48
kubben25-Apr-07 5:48 
QuestionBlocking Multiple Application accessing the same file Pin
girijaa25-Apr-07 4:33
professionalgirijaa25-Apr-07 4:33 
AnswerRe: Blocking Multiple Application accessing the same file Pin
Colin Angus Mackay25-Apr-07 4:47
Colin Angus Mackay25-Apr-07 4:47 
AnswerRe: Blocking Multiple Application accessing the same file Pin
Tim Paaschen25-Apr-07 19:50
Tim Paaschen25-Apr-07 19:50 
QuestionContextMenu and ListView problem? Pin
Khoramdin25-Apr-07 4:25
Khoramdin25-Apr-07 4:25 
Hello everyone,

I have a listview in my Windows Application which I wish to add some functionality to it's item. Since I wish the contextMenu to pop up only when an item is selected rather than anywhere in the area of ListView, I am using the following code:

 private void listview1_MouseDown(object sender, MouseEventArgs e)<br />
    {<br />
        ListViewHitTestInfo info = listView1.HitTest(e.X, e.Y);<br />
<br />
        if (info.Item != null)<br />
        {<br />
            if (e.Button == MouseButtons.Left)<br />
            {<br />
                if (contextMenuStripListView1 != null)<br />
                {<br />
                    contextMenuStripListView1.Show(listView1, new System.Drawing.Point((e.X + 15), (e.Y + 10)));<br />
                }<br />
            }<br />
        }<br />
    }


everything works fine if I use the LEFT mouse click to pop up the contextMenu as shown in above code. The problem appears once I change the left mouse click to RIGHT mouse click. Since I have another contextMenu which is assigned into the entire Form. I get the local contextMenu (The desired Menu) pop up first, then once I release the mouse I get the second ContextMenu (The undesired Menu) which is assigned to the form pops up. Is there anyway to disable the undesired contextMenu just in the area of listview?

OR should I use a different approach?

Thank you very much for your help and have a great day.

Khoramdin
AnswerRe: ContextMenu and ListView problem? Pin
led mike25-Apr-07 4:33
led mike25-Apr-07 4:33 
QuestionSorting DataGrid when datasource is a DataSet Pin
Chris_Green25-Apr-07 3:35
Chris_Green25-Apr-07 3:35 
AnswerRe: Sorting DataGrid when datasource is a DataSet Pin
kubben25-Apr-07 5:38
kubben25-Apr-07 5:38 
GeneralRe: Sorting DataGrid when datasource is a DataSet Pin
Chris_Green25-Apr-07 5:42
Chris_Green25-Apr-07 5:42 
QuestionCreate a Better looking panel? Pin
Carlos Adriano Portes25-Apr-07 3:16
professionalCarlos Adriano Portes25-Apr-07 3:16 
AnswerRe: Create a Better looking panel? Pin
Patrick Etc.25-Apr-07 4:16
Patrick Etc.25-Apr-07 4:16 
QuestionApplication error question Pin
LCI25-Apr-07 2:53
LCI25-Apr-07 2:53 
AnswerRe: Application error question Pin
Tarakeshwar Reddy25-Apr-07 4:37
professionalTarakeshwar Reddy25-Apr-07 4:37 
QuestionProperties not displayed in Visual Studio Editor Pin
SakthiSurya25-Apr-07 1:56
SakthiSurya25-Apr-07 1:56 
AnswerRe: Properties not displayed in Visual Studio Editor Pin
Christian Graus25-Apr-07 2:14
protectorChristian Graus25-Apr-07 2:14 
GeneralRe: Properties not displayed in Visual Studio Editor Pin
SakthiSurya25-Apr-07 2:27
SakthiSurya25-Apr-07 2:27 
GeneralRe: Properties not displayed in Visual Studio Editor Pin
marky77725-Apr-07 4:14
marky77725-Apr-07 4:14 
GeneralRe: Properties not displayed in Visual Studio Editor Pin
SakthiSurya25-Apr-07 21:35
SakthiSurya25-Apr-07 21:35 
GeneralRe: Properties not displayed in Visual Studio Editor Pin
marky77725-Apr-07 21:42
marky77725-Apr-07 21:42 
AnswerRe: Properties not displayed in Visual Studio Editor Pin
Amr Abdel-Mohsen25-Apr-07 2:25
Amr Abdel-Mohsen25-Apr-07 2:25 
Questionhow to pass a method with parameter(s) to ThreadStart ? Pin
hdv21225-Apr-07 1:36
hdv21225-Apr-07 1:36 
AnswerRe: how to pass a method with parameter(s) to ThreadStart ? Pin
Martin#25-Apr-07 2:07
Martin#25-Apr-07 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.