Click here to Skip to main content
15,903,854 members
Home / Discussions / C#
   

C#

 
GeneralReading a JPEG file into String Pin
AliIMCIn17-Feb-04 6:40
AliIMCIn17-Feb-04 6:40 
GeneralRe: Reading a JPEG file into String Pin
Werdna17-Feb-04 7:20
Werdna17-Feb-04 7:20 
GeneralRe: Reading a JPEG file into String Pin
Werdna17-Feb-04 11:30
Werdna17-Feb-04 11:30 
GeneralRe: Reading a JPEG file into String Pin
Heath Stewart17-Feb-04 12:32
protectorHeath Stewart17-Feb-04 12:32 
GeneralRe: Reading a JPEG file into String Pin
Mazdak17-Feb-04 10:09
Mazdak17-Feb-04 10:09 
GeneralRe: Reading a JPEG file into String Pin
Heath Stewart17-Feb-04 12:26
protectorHeath Stewart17-Feb-04 12:26 
GeneralRe: Reading a JPEG file into String Pin
Mazdak17-Feb-04 18:13
Mazdak17-Feb-04 18:13 
Generalproblem with Textboxes Pin
raheela17-Feb-04 6:22
raheela17-Feb-04 6:22 
GeneralRe: problem with Textboxes Pin
Heath Stewart17-Feb-04 12:23
protectorHeath Stewart17-Feb-04 12:23 
Generalwriting a struct to a binary file Pin
DennisMetz17-Feb-04 4:19
DennisMetz17-Feb-04 4:19 
GeneralRe: writing a struct to a binary file Pin
Heath Stewart17-Feb-04 4:44
protectorHeath Stewart17-Feb-04 4:44 
GeneralRe: writing a struct to a binary file Pin
DennisMetz17-Feb-04 5:06
DennisMetz17-Feb-04 5:06 
GeneralRe: writing a struct to a binary file Pin
Heath Stewart17-Feb-04 6:19
protectorHeath Stewart17-Feb-04 6:19 
Generalcatch tabpage change Pin
troels_sorensen17-Feb-04 3:41
troels_sorensen17-Feb-04 3:41 
GeneralRe: catch tabpage change Pin
Heath Stewart17-Feb-04 4:07
protectorHeath Stewart17-Feb-04 4:07 
GeneralRe: catch tabpage change Pin
Anonymous17-Feb-04 8:44
Anonymous17-Feb-04 8:44 
GeneralRe: catch tabpage change Pin
Heath Stewart17-Feb-04 9:21
protectorHeath Stewart17-Feb-04 9:21 
GeneralRe: catch tabpage change Pin
Anonymous17-Feb-04 10:56
Anonymous17-Feb-04 10:56 
GeneralRe: catch tabpage change Pin
Heath Stewart17-Feb-04 12:14
protectorHeath Stewart17-Feb-04 12:14 
GeneralRe: catch tabpage change Pin
Anonymous17-Feb-04 12:59
Anonymous17-Feb-04 12:59 
GeneralRe: catch tabpage change Pin
troels_sorensen18-Feb-04 21:15
troels_sorensen18-Feb-04 21:15 
GeneralRe: catch tabpage change Pin
Heath Stewart19-Feb-04 3:30
protectorHeath Stewart19-Feb-04 3:30 
As with all Windows Common Controls, you can find these in the Platform SDK on MSDN Library Online[^]. For the common controls, see http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/wincontrols.asp[^]. Under "Individual Controls" you'll find documentation on the control messages you want. You should take a look at the rest of the stuff, too.

You can try overriding OnKeyDown, although IIRC Ctrl+Tab is handled a little differently. You can find more information about handling the notification messages in the application pump (using an IMessageFilter perhaps) if this is the case in the .NET Framework SDK (find the interface in the help index I mentioned) and in the Platform SDK.

In order to determine which tab he clicked on, you're going to have to do a lot of this yourself. You can override the OnMouseDown event which gives you coordinates relative to the client (TabControl). Then enumerate your TabPages and call TabControl.GetTabRect with each one (or rather, their index) and use Rectangle.Contains to see which they clicked on. Other ways most likely won't work because you stopped the tabs from changing, so the other messages that fire events in .NET won't be sent and received.

In cases when you derive a control, you should override the OnEvent method, calling base.OnEvent before or after your code (depending on the circumstances). Handle these events from outside the class. This improves performance slightly and makes for a better polymorphic design.

 

Microsoft MVP, Visual C#
My Articles
Generalpictures in a datagrid Pin
troels_sorensen17-Feb-04 3:38
troels_sorensen17-Feb-04 3:38 
GeneralRe: pictures in a datagrid Pin
Heath Stewart17-Feb-04 4:21
protectorHeath Stewart17-Feb-04 4:21 
Questionneed sql query? Pin
murali_utr17-Feb-04 3:19
murali_utr17-Feb-04 3:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.