Is there a way to make input "pass through" a child window and reach its parent? My problem is this: I'm making custom control with a label that can be formatted. So, rather than trying to re-invent the wheel, I added a RichTextEdit
control and applied the WS_EX_TRANSPARENT
extended window style. It looks like what I want, but there are obvious focus and input issues. Is there an effective way to pass on the child window's messages to the parent or apply a set of styles thus making the child window appear to just be text drawn on the button?
views:
150answers:
3
A:
You could use PostMessage to send windows messages to your child window.
James
2009-12-04 11:56:00
A:
Have you tried setting TabStop False and Locked True?
Apologies if you have already tried it.
MarkJ
2009-12-04 17:53:23
I would try setting WS_DISABLED on the richedit instead.
wqw
2009-12-04 22:23:15
Disabled controls have a different look, but im using the WM_PAINT/Blt method. Thanks though.
Xiphias3
2009-12-06 18:28:02
Yes, but in this case you can always put it in a PictureBox and disable it instead, to retain enabled look with disabled interaction
wqw
2009-12-09 23:51:10
A:
You can do this fairly easily by overriding the WM_NCHITTEST message and returning HTTRANSPARENT
. Just be sure to turn off WS_TABSTOP
also so the control cannot be tabbed into.
Stephen Nutt
2009-12-06 01:53:40
Wow thanks! I'll definitely keep this in mind, however i went with the TransparentBlt method and kept a 32bpp image of the text so i can apply image transformation through the use of a ColorMatrix with GDIPlus. Thanks again.
Xiphias3
2009-12-06 18:26:26