Troubleshooting CTRL + A

Discussions about the ThumbnailEx control of GdPicture.NET.
Post Reply
MrH
Posts: 14
Joined: Mon Feb 16, 2015 11:15 am

Troubleshooting CTRL + A

Post by MrH » Mon Jun 15, 2015 4:02 pm

Hello every one,

I build an application with the functionality to see the GDViewer or see the ThumbnailViewer.
If the user presses CTRL + A the view switch between the controls, so far so good, but if I select a Page on the ThumbnailViewer this behaviour don’t work anymore because the ThumbnailViewer or the selected item catches this keyinput.

If I want the behaviour I intend, I have to click on the GDViewer control.
I tried to override the KeyInput from the ThumbnailViewer but it didn’t work and I tried to set the focus on the GdViewer manually with the method Focus() after I’ve selected a page in the ThumbnailViewer but this didn’t work either.

Do you have any suggestion for my problem?

Oh I almost forgot to say, I turned the multiselection possibility off, so it is false. Well if I set this option to true all pages in the ThumbnailViewer will be selected. So this works properly.

Kind regards
MrH

Cedric
Posts: 263
Joined: Sun Sep 02, 2012 7:30 pm

Re: Troubleshooting CTRL + A

Post by Cedric » Wed Jun 17, 2015 10:55 am

Hello,

It is considered as a bad practice to deflect the Windows standard hotkeys, CTRL+A is meant to "select all" the same way CTRL+C is for copy, CTRL+V for paste, etc...
Your best option would be to try through the RegisterHotKey function : https://msdn.microsoft.com/en-us/librar ... 2147217396
Here is a blog article showing how to use it http://www.fluxbytes.com/csharp/how-to- ... tion-in-c/

Cheers!

MrH
Posts: 14
Joined: Mon Feb 16, 2015 11:15 am

Re: Troubleshooting CTRL + A

Post by MrH » Thu Jun 18, 2015 4:10 pm

Hi Cedric,
thanks for your help. I will have a look into it.

[Edit]
So I worked on it and it really works.

I had to change a few things to make it work under C# WPF, for example
the WPF Key-Enum (A = 44) has an other order for its ordinals than the Winforms Keys-Enum (A = 65) and I had to register my own WinProc Method because this do not exists in a WPF Windows class.

So many thanks again Cedric for your help and inspiring links. :D
[/Edit]
Kind regards
MrH

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest