tags:

views:

36

answers:

1

Can we accomplish on Winforms both Tunneling and Bubbling? Maybe by using some API Message Interception? Any article about that?

+2  A: 

Windows Forms was not designed to handle that. You would need to make your own event aggregator, implement your own visual or logical tree, etc, in order to make it work.

If you want this behavior, I recommend just using WPF.

Reed Copsey
Ok I agree.. but for an existing Control at least the bubbling can it be implemented by receiving the Windows Message and sending it to it's parent control?
jmayor
Every control in the chain would need to do this, and do it in a consistent way. You'd basically need to implement your own entire control library, in addition to changing the EventArgs to a type which handled the routing (so you can mark it as handled, and prevent it from continuing the bubbling). Just resending a message will not do it, as you'd lose the info about the control that fired the message, etc. Again, if you want WPF functionality, I'd just use WPF.
Reed Copsey
Thanks very much.. I love WPF but I have one concern about it does WPF renders well in a remote desktop environment? This is the only thing that stops me because I think remake the whole control in WPF might be easier than implememnt all this bubbling events on WinForms.
jmayor
Remote desktop is fine, terminal services is okay - but depends on what you're using. If you're doing standard WPF (not trying to host D3D in WPF, for example), it works great, especially post .NET 3.5sp1.
Reed Copsey
Thanks again :)
jmayor