473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

protected override bool not working fine

1
I am developing an application in visual studio 2012. in MainClass

Expand|Select|Wrap|Line Numbers
  1.  
  2. public static bool shrtcutky(System.Windows.Forms.Keys e, System.Windows.Forms.Form myform, System.Windows.Forms.ToolStrip tolbr, String db, String cmd, String ky, String[] arr)
  3.     {
  4.         switch (e)
  5.         {
  6.             case System.Windows.Forms.Keys.F4 | System.Windows.Forms.Keys.Control:
  7.                 {
  8.                     myform.Close();
  9.                     return true;                                               
  10.                 }
  11.             case System.Windows.Forms.Keys.F3:
  12.                 {
  13.                     SetCancelBtn(myform, tolbr);                        
  14.                     return true;
  15.                 }
  16.             case System.Windows.Forms.Keys.F5 :
  17.                 {
  18.                     return true;
  19.                 }
  20.             case System.Windows.Forms.Keys.F6 :
  21.                 {
  22.                     return true;
  23.                 }
  24.             case System.Windows.Forms.Keys.F7:
  25.                 {
  26.                     System.Windows.Forms.Form FViewAll = new FViewAll(myform, tolbr, db, cmd, ky, arr);
  27.                     FViewAll.ShowDialog(myform);
  28.                     getLan(FViewAll);
  29.                     return true;
  30.                 }
  31.             case System.Windows.Forms.Keys.F8:
  32.                 {
  33.                     SetFirstBtn(myform, tolbr, db, ky);
  34.                     return true;
  35.                 }
  36.             case System.Windows.Forms.Keys.F9 :
  37.                 {
  38.                     if (Int32.Parse(tolbr.AccessibleDescription) > 1)
  39.                         SetPrvBtn(myform, tolbr, db, ky);
  40.                     return true;
  41.                 }
  42.             case System.Windows.Forms.Keys.F10:
  43.                 {
  44.                     if (Int32.Parse(tolbr.AccessibleDescription) < Int32.Parse(tolbr.AccessibleName))
  45.                         SetNextBtn(myform, tolbr, db, ky);
  46.                     return true;
  47.                 }
  48.             case System.Windows.Forms.Keys.F11 :
  49.                 {
  50.                     SetLastBtn(myform, tolbr, db, ky);
  51.                     return true;
  52.                 }                    
  53.         }
  54.         return true;
  55.     }
  56.  
  57. }
  58.  
  59.  
In Calling Form

Expand|Select|Wrap|Line Numbers
  1.  
  2.  protected override bool ProcessCmdKey(ref Message message, Keys keys)
  3.     {            
  4.         MainClass.shrtcutky(keys, this, Toolbar, db, cmd, ky, arr);
  5.         return base.ProcessCmdKey(ref message, keys);
  6.     }
  7.  
It works sometimes and sometimes doesn't .
Example : When i use the F8 key it works well,but When using the F9 key it do nothing . when i try to debug it works well.
Feb 26 '15 #1
0 1210

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Larry Woods | last post by:
I have a site that works fine for days, then suddenly, I start getting ASP 0115 errors with an indication that session variables IN SEPARATE SESSIONS have disappeared! First, for background...
1
by: Dinesh | last post by:
Dear Friends, IIS is not working fine, sometime it works fine and sometime pages are taking lomg time. and same time FTP is not able to upload and doanload anything. It accepts username and...
8
by: Keith Smith | last post by:
Could some one help me a little? I am trying to understand when/where you would ever want to use "protected override..." code such as this. How is this any different from creating a...
4
by: Jon | last post by:
Hi! I'm creating a custom Server Control which implements the method in the subject line (Protected override void CreateChildControls) In here I have the following code: LBL myLbl = new...
3
by: gordon | last post by:
can someone please explain what protected override void is ? what is it used for? thanks Doug
3
by: vishwa Ram | last post by:
Hi All, Please see my below code. my $dir = $ARGV; #Getting command line argument (path of the file) foreach $file (<$dir*.xml>) # Error here when i run exe only. In my above...
7
by: =?Utf-8?B?cmFtbzk5NDE=?= | last post by:
Hi, Is there any way disable using "protected override void OnPaint(..." method out of the assembly. I create usercontrol and i do not want user adds extra codes OnPaint method for securtity...
2
by: Gaurav Pruthi | last post by:
I have embedded a sidebar menu in the web page , Although it is working fine with Mozilla firefox , but in IE8 I am facing problem what is happening is : - I am not able to select submenu item...
1
by: abdulkahar | last post by:
sorry i want to know this <meaning of protected override>. and could you please tell me the meaning above
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.