From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.net picturebox surfaces from unselected tab

I have an app that makes extensive use of the .net picture control to draw a radar type display.  The picture control is nested within a 5 page tab control.  Occationally, something happens and the picture control seems to rise to the surface of the UI independant of which tab is selected.  It is like it has decided to just start redrawing itself over the tab control or perhaps the tab control is failing to redraw itself over the .net picturebox.  Has anyone seen something like this before?

 

Thanks,

 

LV2012 SP1

0 Kudos
Message 1 of 8
(2,309 Views)

Not with a .NET container and not with a tab, but an ActiveX container, as far as I know, is implemented as a separate window (probably a child window). If the .NET container is also implemented like that, then it seems plausible that LV might fail to draw it correctly occasionally.

 

You could try seeing if you can find the window (using a program like Spy++ to verify it exists and enumerating the child windows of the FP window to find it) and then play with the z order if the tab page is hidden, but I wouldn't recommend that, as messing with something like that seems dangerous. You could try something like occasionally deferring panel updates or using the value property to set the page of the tab, but a polling action doesn't seem that useful.

 

Instead, I would suggest trying to put the container in a subpanel. I have no idea if that will help (although it probably would if the subpanel replaced the tab completely), but it sounds like the safest option.


___________________
Try to take over the world!
0 Kudos
Message 2 of 8
(2,303 Views)

My experience is that when you tell that guy to paint itself, it knows its screen coordinates and it dutifully paints itself.  It knows nothing of Tabs.  You have to handle the timing of the paint events yourself.

0 Kudos
Message 3 of 8
(2,302 Views)

@tst wrote:

 

You could try seeing if you can find the window (using a program like Spy++ to verify it exists and enumerating the child windows of the FP window to find it) and then play with the z order if the tab page is hidden, but I wouldn't recommend that, as messing with something like that seems dangerous. You could try something like occasionally deferring panel updates or using the value property to set the page of the tab, but a polling action doesn't seem that useful.

 

Instead, I would suggest trying to put the container in a subpanel. I have no idea if that will help (although it probably would if the subpanel replaced the tab completely), but it sounds like the safest option.


I've tried the defer front panel and again it doesn't do any thing, because the control is like a seperate window.  If you can get the HWND of the .Net control you could call a Windows function to hide it.  Or possibly set the control to not visible (probably easier actually)

0 Kudos
Message 4 of 8
(2,289 Views)

The thing is is that 99.9% of the time everything works fine.  .net picturebox updates happen and tab changes can occur without any problems.

There was a curious 2011 bug fix -

http://www.ni.com/white-paper/13257/en

Issue 238284  that sounds similar to what I am experiencing.

0 Kudos
Message 5 of 8
(2,284 Views)

One other thing is that once it happens the only way to fix it is to restart the app.  Changing tabs, minimizing the app, moving other windows over, nothing will resurect the correct tab layering.  The .net picturebox remains at the top of the Z order.

0 Kudos
Message 6 of 8
(2,277 Views)

Can you use ONE picture box floating on top of the tab control ?

Update the picture box whenever tab changes.

 

George Zou
Message 7 of 8
(2,273 Views)

I do have only one picturebox which is on the first tab of a 5 tab control.  I suppose I could try making the picturebox invisible when the other tab is not selected.  I will give that a try....

0 Kudos
Message 8 of 8
(2,271 Views)