Click here to Skip to main content
15,894,896 members
Home / Discussions / C#
   

C#

 
QuestionMessage Removed Pin
24-Jan-10 8:57
Bizcrack24-Jan-10 8:57 
AnswerRe: C# - get data from MySQL DB into DataGridView Pin
Som Shekhar24-Jan-10 9:06
Som Shekhar24-Jan-10 9:06 
AnswerRe: C# - get data from MySQL DB into DataGridView Pin
Luc Pattyn24-Jan-10 9:48
sitebuilderLuc Pattyn24-Jan-10 9:48 
AnswerRe: C# - get data from MySQL DB into DataGridView Pin
Bizcrack26-Jan-10 5:15
Bizcrack26-Jan-10 5:15 
GeneralRe: C# - get data from MySQL DB into DataGridView Pin
Bizcrack27-Jan-10 4:12
Bizcrack27-Jan-10 4:12 
QuestionAttach scrollbar to listview Pin
Eli Nurman24-Jan-10 8:11
Eli Nurman24-Jan-10 8:11 
AnswerRe: Attach scrollbar to listview Pin
DeepakMega25-Jan-10 1:02
DeepakMega25-Jan-10 1:02 
QuestionContext Menu Not Appearing in Correct Location Pin
kodysumter24-Jan-10 8:10
kodysumter24-Jan-10 8:10 
I am Manually calling a context menu from a listview based on if it is on an item or not. When i right-click, the function validates if an item is present or not, then shows the correct contextMenu.

The problem that i am running into is that the context menu is showing quiet a bit off of the correct coordinates, (top-left of the mouse, off by an inch or so)

Here is an exert of that code.

private void iconView_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                ListViewHitTestInfo hitTestInfo = iconView.HitTest(e.Location);
                string filePath, fName;
                
                if (hitTestInfo.Item != null)
                {
                    fName = hitTestInfo.Item.Text;
                    filePath = getNodePath();
                    filePath = filePath + @"\" + fName;
                    
                    //Code Courtesy of CodeProject!
                    ShellMenu.ShellContextMenu ctxMnu = new ShellMenu.ShellContextMenu();
                    FileInfo[] arrFI = new FileInfo[1];
                    arrFI[0] = new FileInfo(filePath);
                    ctxMnu.ShowContextMenu(arrFI, this.PointToScreen(e.Location));
                    //End Code Project
                }
                else
                {
                    iconContext.Visible = true;
                    iconContext.Show(this, e.Location);
                }
            }
        }
    }


Here is the kicker, i am using a fellow coders ShellContextCode, and it is doing the same thing, so i am pretty sure something is not happening on an application or system level.

-Edit-

Just had a brainstorm, maybe the location being reported is relative to the app, then the input is relative to the screen. I am going to test this while waiting for an experts view.
AnswerRe: Context Menu Not Appearing in Correct Location Pin
Som Shekhar24-Jan-10 8:18
Som Shekhar24-Jan-10 8:18 
GeneralRe: Context Menu Not Appearing in Correct Location Pin
kodysumter24-Jan-10 14:08
kodysumter24-Jan-10 14:08 
GeneralRe: Context Menu Not Appearing in Correct Location Pin
Som Shekhar24-Jan-10 18:02
Som Shekhar24-Jan-10 18:02 
GeneralRe: Context Menu Not Appearing in Correct Location Pin
kodysumter25-Jan-10 15:09
kodysumter25-Jan-10 15:09 
GeneralRe: Context Menu Not Appearing in Correct Location Pin
Som Shekhar25-Jan-10 19:20
Som Shekhar25-Jan-10 19:20 
Questioncombobox datasource switch Pin
Erdinc2724-Jan-10 6:18
Erdinc2724-Jan-10 6:18 
AnswerRe: combobox datasource switch Pin
Abhinav S24-Jan-10 6:22
Abhinav S24-Jan-10 6:22 
GeneralRe: combobox datasource switch Pin
Erdinc2725-Jan-10 4:00
Erdinc2725-Jan-10 4:00 
QuestionXmlAttributeAttribute filter by value ? Pin
GoodIntentions24-Jan-10 4:23
GoodIntentions24-Jan-10 4:23 
QuestionTransferring focus from a textbox to a button Pin
gamer112724-Jan-10 2:49
gamer112724-Jan-10 2:49 
AnswerRe: Transferring focus from a textbox to a button Pin
Som Shekhar24-Jan-10 3:06
Som Shekhar24-Jan-10 3:06 
GeneralRe: Transferring focus from a textbox to a button Pin
Rod Kemp24-Jan-10 3:16
Rod Kemp24-Jan-10 3:16 
GeneralRe: Transferring focus from a textbox to a button Pin
Som Shekhar24-Jan-10 3:18
Som Shekhar24-Jan-10 3:18 
GeneralRe: Transferring focus from a textbox to a button [Modified] Pin
Rod Kemp24-Jan-10 3:34
Rod Kemp24-Jan-10 3:34 
AnswerRe: Transferring focus from a textbox to a button Pin
Jimmanuel24-Jan-10 3:16
Jimmanuel24-Jan-10 3:16 
GeneralRe: Transferring focus from a textbox to a button Pin
gamer112724-Jan-10 3:53
gamer112724-Jan-10 3:53 
GeneralRe: Transferring focus from a textbox to a button Pin
Jimmanuel24-Jan-10 4:23
Jimmanuel24-Jan-10 4:23 

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.