Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ControlHost and Z order (Read 3997 times)
Jason McNair
Guest


ControlHost and Z order
Jul 25th, 2006 at 4:34pm
Print Post  
I'm having trouble with Z ordering my ControlHosts.  If I use 'Box'es I can control layering of the Box objects with Ztop, Zbottom, Zindex, etc., but none of these seem to affect ControlHost objects.  Anyone have any ideas as to why?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3381
Joined: Oct 19th, 2005
Re: ControlHost and Z order
Reply #1 - Jul 26th, 2006 at 4:43am
Print Post  
The controls hosted in ControlHost nodes have their own windows whose Z order is controlled by the Windows' window manager. Use the BringToFront and SendToBack methods of the hosted Control objects instead the ZIndex property of the ControlHosts.
  
Back to top
 
IP Logged
 
Akira
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Nov 13th, 2006
Re: ControlHost and Z order
Reply #2 - Nov 13th, 2006 at 8:31am
Print Post  
Hello,

as you all can see this is my first post here and my hopes are high that someone of you guys can help me.

Like Jason above I've a problem with the Z values of the ControlHosts and Boxes.

My problem:
I can change the Z value for boxes via ZTop, ZBottom ect and for ControlHosts via SendToBack and BringToFront. Both works fine, when it is used for objects from the same type.
But in some cases I would like to bring a box from behind a ControlHost to the front of it.
But no matter what I do, the ControlHosts are always in the foreground.
I guess it has something to do how the Z ordering is controlled (from FlowChart or Windows).

Therefore, I would like to know if there is a trick or solution so that boxes can be draw before ControlHosts if needed?
If not, is there a possibility to have this feature implemented in a upcoming update of FlowChart.NET?

I thank you guys in advance for your reply.


Cheers Thorsten
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ControlHost and Z order
Reply #3 - Nov 13th, 2006 at 10:09am
Print Post  
Hello Thorsten,

Unfortunately Flowchart.NET cannot draw inside the windows of controls hosted in ControlHost nodes, so the boxes always appear below the ControlHosts.

That will change in the WPF version of FlowChar.NET, where both boxes and hosted controls will be drawn on the same surface as a part of the same WPF visual tree.

For now you might try to use ControlHosts only as some kind of node editors, displayed when a box is double clicked. When the user finishes entering data, create a bitmap representing the ControlHost contents, display the bitmap inside the box and close the editor control. It depends on the type of hosted control whether you can draw its contents in a bitmap. E.g. some controls in .NET 2 support a DrawToBitmap method that will let you do that. For other controls you might have to use other means, e.g. send some special Windows messages to them.

Stoyan
  
Back to top
 
IP Logged
 
Akira
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Nov 13th, 2006
Re: ControlHost and Z order
Reply #4 - Nov 13th, 2006 at 10:30am
Print Post  
Stoyo,

thanks for your quick and complete reply.

Well, I'll try my luck with a workaround till the WPF version of FlowChart.Net is available Smiley

Thorsten

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint