Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

1 solution

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[^]
 
Share this answer
 
v2
Comments
M_Mogharrabi 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 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900