05-06-2013 02:09 PM
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
05-06-2013 02:28 PM
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.
05-06-2013 02:29 PM
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.
05-06-2013 03:21 PM
@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)
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-06-2013 03:27 PM
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.
05-06-2013 03:52 PM
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.
05-06-2013 04:03 PM
Can you use ONE picture box floating on top of the tab control ?
Update the picture box whenever tab changes.
05-06-2013 04:09 PM
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....