Click here to Skip to main content
16,004,564 members
Home / Discussions / C#
   

C#

 
AnswerRe: i need code Pin
Pete O'Hanlon26-Sep-07 0:38
mvePete O'Hanlon26-Sep-07 0:38 
GeneralRe: i need code Pin
J4amieC26-Sep-07 1:43
J4amieC26-Sep-07 1:43 
GeneralRe: i need code Pin
Vasudevan Deepak Kumar27-Sep-07 6:12
Vasudevan Deepak Kumar27-Sep-07 6:12 
Answeri need club Pin
Dan Neely26-Sep-07 2:18
Dan Neely26-Sep-07 2:18 
AnswerRe: i need code Pin
Malcolm Smart26-Sep-07 2:42
Malcolm Smart26-Sep-07 2:42 
AnswerRe: i need code Pin
J a a n s27-Sep-07 4:47
professionalJ a a n s27-Sep-07 4:47 
QuestionContex Menu Pin
half-life25-Sep-07 23:52
half-life25-Sep-07 23:52 
AnswerRe: Contex Menu Pin
ESTAN26-Sep-07 0:18
ESTAN26-Sep-07 0:18 
Well, i never tried it, but i think yes. I do the following for a treeview, i suppose you could do the same for a datagrid. One condition. You do not link the context menu to the datagrid.

The code will try to find out the node where you clicked, and if it is a node, show you the contextmenu.
Some additional code is inside because i am using only one context menu, but i am changing some things depending the selected node.

I hope it helps.


private void m_tvAdvertisements_MouseUp(object sender, MouseEventArgs e)<br />
        {<br />
            if (e.Button != MouseButtons.Right) return;<br />
<br />
            Point pt = new Point(e.X, e.Y);<br />
            m_tvAdvertisements.PointToClient(pt);<br />
<br />
            TreeNode Node = m_tvAdvertisements.GetNodeAt(pt);<br />
            if (Node == null) return;<br />
<br />
            if (Node.Bounds.Contains(pt))<br />
            {<br />
                m_tvAdvertisements.SelectedNode = Node;<br />
<br />
                if (Node.Tag == null)<br />
                {<br />
                    deleteAdvertisementToolStripMenuItem.Enabled = false;<br />
                    enableAdvertisementToolStripMenuItem.Enabled = false;<br />
                }<br />
                else<br />
                {<br />
                    deleteAdvertisementToolStripMenuItem.Enabled = true;<br />
                    SMSAdvertisementItem i = Node.Tag as SMSAdvertisementItem;<br />
                    SMSProgramItem p = FindProgramItem(i.PackageID, i.ProgramName);<br />
                    if (p == null)<br />
                    {<br />
                        enableAdvertisementToolStripMenuItem.Enabled = true;<br />
                    }<br />
                    else<br />
                    {<br />
                        if (p.ProgramEnabled)<br />
                            enableAdvertisementToolStripMenuItem.Text = "Disable Program";<br />
                        else<br />
                            enableAdvertisementToolStripMenuItem.Text = "Enable Program";<br />
<br />
                        enableAdvertisementToolStripMenuItem.Enabled = true;<br />
                    }<br />
                }<br />
<br />
                m_cmTreeContextMenu.Show(m_tvAdvertisements, pt);                     <br />
            }<br />
        }

GeneralRe: Contex Menu Pin
half-life26-Sep-07 3:10
half-life26-Sep-07 3:10 
AnswerRe: Contex Menu Pin
ESTAN26-Sep-07 4:23
ESTAN26-Sep-07 4:23 
QuestionSaving Copy of Dataset while in runtime Pin
Bonsta25-Sep-07 23:40
Bonsta25-Sep-07 23:40 
AnswerRe: Saving Copy of Dataset while in runtime Pin
blackjack215025-Sep-07 23:58
blackjack215025-Sep-07 23:58 
Questionhow can I disable the xp hot key Pin
lockepeak25-Sep-07 22:56
lockepeak25-Sep-07 22:56 
AnswerRe: how can I disable the xp hot key Pin
TJoe26-Sep-07 2:30
TJoe26-Sep-07 2:30 
QuestionGetting the associated executable - regex help! Pin
benjymous25-Sep-07 22:51
benjymous25-Sep-07 22:51 
AnswerRe: Getting the associated executable - regex help! Pin
m@u25-Sep-07 23:57
m@u25-Sep-07 23:57 
GeneralRe: Getting the associated executable - regex help! Pin
benjymous26-Sep-07 0:27
benjymous26-Sep-07 0:27 
GeneralRe: Getting the associated executable - regex help! Pin
m@u26-Sep-07 2:15
m@u26-Sep-07 2:15 
QuestionHow can i change color of part of the text that will appear on Static Label ? Pin
Yanshof25-Sep-07 22:38
Yanshof25-Sep-07 22:38 
AnswerRe: How can i change color of part of the text that will appear on Static Label ? Pin
Christian Graus25-Sep-07 22:42
protectorChristian Graus25-Sep-07 22:42 
GeneralRe: How can i change color of part of the text that will appear on Static Label ? Pin
Yanshof25-Sep-07 22:50
Yanshof25-Sep-07 22:50 
GeneralRe: How can i change color of part of the text that will appear on Static Label ? Pin
Malcolm Smart26-Sep-07 3:48
Malcolm Smart26-Sep-07 3:48 
GeneralRe: How can i change color of part of the text that will appear on Static Label ? Pin
Pete O'Hanlon26-Sep-07 9:40
mvePete O'Hanlon26-Sep-07 9:40 
QuestionHelp access database and select statement Pin
KppsK25-Sep-07 22:35
KppsK25-Sep-07 22:35 
AnswerRe: Help access database and select statement Pin
Christian Graus25-Sep-07 22:43
protectorChristian Graus25-Sep-07 22:43 

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.