LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ZPlane Order of an ActiveX Control

I have an ActiveX control on my panel (it happens to be the "MS webbrowser", but based on my experiements the following is true for any ActiveX control), and I want to place another control on top of the ActiveX control.  No matter what I do to the ZPlane order of either control, the ActiveX always covers up the other control.  Is there a way around this?
0 Kudos
Message 1 of 3
(3,514 Views)
From the ATTR_ZPLANE_POSITION help....
 
Note: An ActiveX control that is not in Windowless mode is always drawn above all other non-ActiveX controls, and above all other ActiveX controls in Windowless mode, regardless of its Z-plane position.
The reason for this is that windowed activex controls draw themselves, and have their own child windows to do so. CVI draws the regular CVI controls (and windowless activex controls) on the window of the top level CVI panel, so when an activex control uses it's own child window to draw itself, it will always overlap whatever CVI draws on the parent window.
 
As a possible workaround, you could put CVI controls on a child panel, hide the title bar and frame, and size the child panel to be the same size of the control that you want to go on top of the activex control. The disadvantage to this workaround is that those controls on the child panel won't be in the tab order of the controls on the parent panel. So instead of putting those controls that you want to overlap a windowed activex control on a regular child panel, you could put them on a tab control with a single tab page. The tab control uses child panels for the tab pages, and the tab control takes care of the tab order.
 
I've attached a .uir file as an example.
 
Hope this helps.
 
- jared
Message 2 of 3
(3,494 Views)

TonyG,

Jared is correct; unfortunately layering ActiveX over non-ActiveX controls is problematic.  ActiveX controls can be properly layerd over one another though, so you might be able to use multiple ActiveX controls and layer those as you desire, but that would be an additional level of complexity.

There might be a long-term solution.  In Visual Studio you can layer ActiveX controls with normal controls because of the way that VS handles the ActiveX controls.  I think that you might want to file a Product Suggestion to our R&D department to see if we can look into incorporating similar functionality into CVI in the future.  If we could replicate the way they handle the controls then maybe we could eliminate this problem in the future.

John B.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(3,488 Views)