Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / December 2004

Tip: Looking for answers? Try searching our database.

Can't overrode ProcessCmdKey in clontrol

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Teis Draiby - 20 Dec 2004 15:53 GMT
I want to catch key shortcuts in a control by using ProcessCmdKey (using
C#), but i get a compiler error: "no suitable method found to override".
What am I doing wrong.
Is it because I'm using .NET Framework 1.0??

Any answer is very much appreciated,
regards Teis
Herfried K. Wagner [MVP] - 20 Dec 2004 18:42 GMT
"Teis Draiby" <teisREMOVE-THIS@draiby.com> schrieb:
>I want to catch key shortcuts in a control by using ProcessCmdKey (using
> C#), but i get a compiler error: "no suitable method found to override".
> What am I doing wrong.

Are you sure you used the right parameters?  Post your code!

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/

Teis Draiby - 20 Dec 2004 23:23 GMT
It goes like this:

protected override bool ProcessCmdKey(Message msg, Keys keyData)
{
   MessageBox.Show(keyData.ToString());
   return true;
}

regards, Teis
Herfried K. Wagner [MVP] - 20 Dec 2004 23:28 GMT
"Teis Draiby" <teisREMOVE-THIS@draiby.com> schrieb:
> protected override bool ProcessCmdKey(Message msg, Keys keyData)

Add 'ref' in front of 'Message msg'.

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/

Teis Draiby - 21 Dec 2004 06:38 GMT
: )
- That's why I love the internet

Thank you very much, Teis

> Add 'ref' in front of 'Message msg'.
> M S   Herfried K. Wagner

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.