Neil Pate Posted September 2, 2016 Report Share Posted September 2, 2016 (edited) I have created some code that is supposed to store a VIs FP.PanelBounds to disk and them restore them later so that window positions are persisted between runs of the executable. Everything works perfectly in the IDE, but in an executable I get strange behaviour. The most common thing that goes wrong is that the window is vertically shifted down by some very noticeable number of pixels, approximately equal to my Windows taskbar (by eyeball measurement). Sometimes it does work though, and it seems to be only on the first load of the executable that the position is set incorrectly. While the exe is running I can close windows and restore them in the correct place (but perhaps then my VI is still in memory or something) I have probed around and the values being persisted to disk and read back are correct, the bug seems to be in the setting of the FP.PanelBounds property. I suspected it could something in Windows (like the restoring animation) interfering with LabVIEW as the window "appears" but I have disabled this and still no difference. Am I doing something silly here? There seem to be lots of different properties for setting window bounds and stuff like this (see https://decibel.ni.com/content/docs/DOC-22385) so perhaps I am doing this a dumb way? I am pretty sure I used this technique on Win XP and LabVIEW 8.6 and it worked perfectly. At the moment using Win 10 and LV2015SP1. Edited September 2, 2016 by Neil Pate Added URL Quote Link to comment
ShaunR Posted September 2, 2016 Report Share Posted September 2, 2016 Make sure the VI is running before setting its position/size. This effect usually occurs when you use an external window sizer/positioner to the VI that you want to position (rather than on its own diagram) because the FP opens but the menus, title bar and sliders are visible (depending of FP settings) before they are hidden when running. 1 Quote Link to comment
Neil Pate Posted September 2, 2016 Author Report Share Posted September 2, 2016 Dang, so simples :-) Thanks Shaun. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.