Click here to Skip to main content
15,905,071 members
Home / Discussions / C#
   

C#

 
GeneralRe: looking for code to logout in multiple browser tab Pin
Ramug1018-Feb-14 22:08
Ramug1018-Feb-14 22:08 
QuestionHow to load a function first? Pin
Member 776638518-Feb-14 0:28
Member 776638518-Feb-14 0:28 
AnswerRe: How to load a function first? Pin
Keith Barrow18-Feb-14 2:32
professionalKeith Barrow18-Feb-14 2:32 
GeneralRe: How to load a function first? Pin
Member 776638518-Feb-14 9:07
Member 776638518-Feb-14 9:07 
QuestionGetting rid of extra click... Pin
Danish Samil18-Feb-14 0:08
Danish Samil18-Feb-14 0:08 
AnswerRe: Getting rid of extra click... Pin
Shameel18-Feb-14 2:47
professionalShameel18-Feb-14 2:47 
GeneralRe: Getting rid of extra click... Pin
Danish Samil18-Feb-14 10:41
Danish Samil18-Feb-14 10:41 
AnswerRe: Getting rid of extra click... Pin
TnTinMn18-Feb-14 12:52
TnTinMn18-Feb-14 12:52 
I played with this concept once. The issue is that when Word is focused, the form is deactivated. You could use the form activated event but that would fire if you jumped to the form using Alt-Tab. The code shown below detects the WM_Activate message sent to the form and verifies that it was generated by a mouse-click.

C#
private const Int32 WM_ACTIVATE = 0x6;
private const Int32 WA_CLICKACTIVE = 0x2;
protected override void WndProc(ref Message m)
{
    base.WndProc(ref m);
    //detect mouse click activation
    if (m.Msg == WM_ACTIVATE && m.WParam.ToInt64() == WA_CLICKACTIVE)
    {
        // get mouse position relative to toolstrip ClientWindow
        Point pt = toolStrip1.PointToClient(Cursor.Position);
        if (toolStrip1.ClientRectangle.Contains(pt))
        {
            // loop the items checking if pt is within its bounds
            foreach (ToolStripItem item in toolStrip1.Items)
            {
                if (item.Bounds.Contains(pt))
                {
                    item.PerformClick(); // click it
                    break;
                }
            }
        }
    }
}

GeneralRe: Getting rid of extra click... Pin
Danish Samil18-Feb-14 19:15
Danish Samil18-Feb-14 19:15 
QuestionHow to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Anand Gunasekaran17-Feb-14 20:49
professionalAnand Gunasekaran17-Feb-14 20:49 
AnswerRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Pete O'Hanlon17-Feb-14 20:52
mvePete O'Hanlon17-Feb-14 20:52 
GeneralRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Anand Gunasekaran17-Feb-14 21:06
professionalAnand Gunasekaran17-Feb-14 21:06 
GeneralRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Pete O'Hanlon17-Feb-14 21:12
mvePete O'Hanlon17-Feb-14 21:12 
AnswerRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
OriginalGriff17-Feb-14 21:01
mveOriginalGriff17-Feb-14 21:01 
GeneralRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Anand Gunasekaran17-Feb-14 21:14
professionalAnand Gunasekaran17-Feb-14 21:14 
GeneralRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Shameel17-Feb-14 22:26
professionalShameel17-Feb-14 22:26 
AnswerRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Shameel18-Feb-14 2:55
professionalShameel18-Feb-14 2:55 
QuestionConvert "\\r\\n" into "\r\n" Pin
Ashfaque Hussain17-Feb-14 20:00
Ashfaque Hussain17-Feb-14 20:00 
AnswerRe: Convert "\\r\\n" into "\r\n" Pin
Kornfeld Eliyahu Peter17-Feb-14 20:06
professionalKornfeld Eliyahu Peter17-Feb-14 20:06 
GeneralRe: Convert "\\r\\n" into "\r\n" Pin
Ashfaque Hussain17-Feb-14 23:02
Ashfaque Hussain17-Feb-14 23:02 
GeneralRe: Convert "\\r\\n" into "\r\n" Pin
Kornfeld Eliyahu Peter17-Feb-14 23:19
professionalKornfeld Eliyahu Peter17-Feb-14 23:19 
GeneralRe: Convert "\\r\\n" into "\r\n" Pin
Ashfaque Hussain17-Feb-14 23:57
Ashfaque Hussain17-Feb-14 23:57 
GeneralRe: Convert "\\r\\n" into "\r\n" Pin
Kornfeld Eliyahu Peter18-Feb-14 0:01
professionalKornfeld Eliyahu Peter18-Feb-14 0:01 
GeneralRe: Convert "\\r\\n" into "\r\n" Pin
Ashfaque Hussain18-Feb-14 0:39
Ashfaque Hussain18-Feb-14 0:39 
AnswerRe: Convert "\\r\\n" into "\r\n" Pin
Pete O'Hanlon17-Feb-14 20:50
mvePete O'Hanlon17-Feb-14 20:50 

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.