Click here to Skip to main content
11,577,143 members (56,589 online)
Rate this: bad
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 0:28am

1 solution

Rate this: bad
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[^]
M_Mogharrabi at 13-Mar-13 1:12am
Hi Abhinav S and thanks.I tested the following code but it had no effect :
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 DamithSL 155
1 OriginalGriff 115
2 Afzaal Ahmad Zeeshan 95
3 Abhinav S 90
4 Lucifier Rocks 85
0 OriginalGriff 820
1 Sergey Alexandrovich Kryukov 631
2 Abhinav S 528
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 365

Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 12 Mar 2013
Copyright © CodeProject, 1999-2015
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