Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: TextBox control Pin
leppie31-Mar-04 6:19
leppie31-Mar-04 6:19 
GeneralClose resource Open by a web cam Pin
Daminda30-Mar-04 22:34
Daminda30-Mar-04 22:34 
GeneralRe: Close resource Open by a web cam Pin
Dave Kreskowiak31-Mar-04 3:26
mveDave Kreskowiak31-Mar-04 3:26 
GeneralAttributes Pin
Appelz30-Mar-04 20:36
Appelz30-Mar-04 20:36 
GeneralRe: Attributes Pin
Mazdak30-Mar-04 20:46
Mazdak30-Mar-04 20:46 
GeneralRe: Attributes Pin
partyganger30-Mar-04 22:39
partyganger30-Mar-04 22:39 
GeneralDetermining Active Custom Multiple Component Component Pin
Tristan Rhodes30-Mar-04 20:35
Tristan Rhodes30-Mar-04 20:35 
GeneralRe: Determining Active Custom Multiple Component Component Pin
Heath Stewart31-Mar-04 4:14
protectorHeath Stewart31-Mar-04 4:14 
The Catalyst wrote:
Is there any way to determine when a child of the base component is activated via the base component?

You mean container? "base" component is something entirely different, i.e. the base class of a derivative class.

Only one control can have focus at a time. This is universal in all window managers. Container controls can, however, receive notification messages from their child controls, although you may have a problem if you're using containers within containers.

Your container control should extend from ContainerControl, or most often one of its derivatives, UserControl. Other controls can handle the following as well, though, so long as they're parent to controls for which you want to receive messages. Again, this is rooted in Win32, so experience with Win32 programming is beneficial.

Just override the WndProc of your container. You'll get notification messages for most child control notification messages as well, so you'll need to distinguish between the handles using the Message.HWnd. You can always get a control from it's handle using the static Control.FromHandle method, too.

Keep the message handling efficient and be sure to call base.WndProc with the reference to the Message struct passed to you when done, otherwise messages won't be dispatched to their destination windows (controls) and nothing will work inside of that container.

 

Microsoft MVP, Visual C#
My Articles
GeneralOpaque Controls Showing Controls Underneath Pin
Tristan Rhodes30-Mar-04 20:31
Tristan Rhodes30-Mar-04 20:31 
GeneralRe: Opaque Controls Showing Controls Underneath Pin
Heath Stewart31-Mar-04 3:56
protectorHeath Stewart31-Mar-04 3:56 
GeneralRe: Opaque Controls Showing Controls Underneath Pin
Jesse Squire1-Apr-04 7:39
Jesse Squire1-Apr-04 7:39 
Generalserializing DataColumns Pin
DougW4830-Mar-04 19:57
DougW4830-Mar-04 19:57 
GeneralRe: serializing DataColumns Pin
Mazdak30-Mar-04 20:10
Mazdak30-Mar-04 20:10 
GeneralRe: serializing DataColumns Pin
Heath Stewart31-Mar-04 3:53
protectorHeath Stewart31-Mar-04 3:53 
GeneralStrange GDI+ error Pin
Anonymous30-Mar-04 19:42
Anonymous30-Mar-04 19:42 
GeneralRe: Strange GDI+ error Pin
Heath Stewart31-Mar-04 3:46
protectorHeath Stewart31-Mar-04 3:46 
GeneralRe: Strange GDI+ error Pin
Stephane David31-Mar-04 10:00
Stephane David31-Mar-04 10:00 
GeneralRe: Strange GDI+ error Pin
Heath Stewart31-Mar-04 10:02
protectorHeath Stewart31-Mar-04 10:02 
GeneralRe: Strange GDI+ error Pin
leppie31-Mar-04 6:21
leppie31-Mar-04 6:21 
General.NET Remoting Pin
Prasad Anand30-Mar-04 18:29
Prasad Anand30-Mar-04 18:29 
GeneralRe: .NET Remoting Pin
Heath Stewart31-Mar-04 3:42
protectorHeath Stewart31-Mar-04 3:42 
GeneralKey Press Pin
DucLinh30-Mar-04 14:54
DucLinh30-Mar-04 14:54 
GeneralRe: Key Press Pin
Charlie Williams30-Mar-04 16:02
Charlie Williams30-Mar-04 16:02 
Generalreading from sqldatareader Pin
pgraeve30-Mar-04 14:39
pgraeve30-Mar-04 14:39 
GeneralRe: reading from sqldatareader Pin
Heath Stewart30-Mar-04 16:42
protectorHeath Stewart30-Mar-04 16:42 

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.