Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Excel WinForm
I need to know the default action of double click or right click in excel?
 
I have used an Excel viewer in my C# Winform application. This viewer opens different .xls files with various number of sheets dynamically. I have to protect all sheets at the beginning of the application and also end of the sheetchange event handler.
 
Now I want to allow user to use some shortcut keys like {F1} or Ctrl+S. But none of the keys are working and I think this is because of the protection that I have applied on sheets. Am I right?
 
I have found that when i double click or right click on a cell all of the keys activated again! so it seems that the excel do what i need in background as its default double or right click action.
 
thanks in advance...
Posted 12-Mar-13 1:28am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You could try to set focus to the component that holds this excel.
This might put excel in focus just like right clicking on it will do!
 
How to Set Focus to Any Form Control[^]
  Permalink  
v2
Comments
M_Mogharrabi at 13-Mar-13 1:12am
   
Hi Abhinav S and thanks.I tested the following code but it had no effect :
myExcelViewer.Focus();
Did you mean something like this?
Abhinav S at 13-Mar-13 1:53am
   
Yup I did mean that. It did appear to be a control fcous issue.
Thanks for trying though.

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

  Print Answers RSS
0 OriginalGriff 295
1 DamithSL 265
2 CPallini 235
3 Maciej Los 190
4 Sergey Alexandrovich Kryukov 174
0 OriginalGriff 5,415
1 DamithSL 4,422
2 Maciej Los 3,820
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,911


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 12 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100