Click here to Skip to main content
11,712,454 members (74,014 online)
Click here to Skip to main content

Tagged as

correct simulate OnClick-Event on every Control in .NET Compact Framework

, 25 Aug 2010 CPOL 7.3K 4
Rate this:
Please Sign up or sign in to vote.
.NET Compact Framework
Your search ends here...

Here is the correct Source to simulate an OnClick-Event on every Control in .NET Compact Framework.

        private static extern void SendMessage(IntPtr hWnd, int msg, int wparam, int lparam);
        const int WM_LBUTTONDOWN = 0x201;
        const int WM_LBUTTONUP = 0x202;
        public void PerformClick(System.Windows.Forms.Control control)
            SendMessage(control.Handle, WM_LBUTTONDOWN, 0, 0);
            SendMessage(control.Handle, WM_LBUTTONUP, 0, 0);


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
Germany Germany
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionWebBrowser Pin
EduardoDW14-Oct-14 8:37
memberEduardoDW14-Oct-14 8:37 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150819.1 | Last Updated 25 Aug 2010
Article Copyright 2010 by Taulie
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid