LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

move window without title bar

i create a vi, Uncheck "Show menu bar" and "Show toolbar when running" from window Appearance, resize the window to fit a control. refer to the following vi, how can i move the window smoothly using mouse event?
 
thanks in advance
0 Kudos
Message 1 of 8
(5,456 Views)
On the G Toolbox website: http://www.geocities.com/gzou999/index.html , G Toolbox, More Examples links, you can find the vi Move Window with no Titlebar.
As you resized the whole window to a control, the code you need may be different, but this should be a good starting point.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 8
(5,433 Views)
Ok, this seems to be a partially duplicate thread, see http://forums.ni.com/ni/board/message?board.id=170&message.id=190581 started from the Brian clone #1.
Waiting contributions from Brian clones from #2 to #4! Smiley Very Happy

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 8
(5,421 Views)
can you try the following VI, any idea to improve it?
 
 
thanks
 
 
0 Kudos
Message 4 of 8
(5,419 Views)
I can't open your vi, can you repost it in 7.1 format (Save with options)?

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 8
(5,419 Views)

the vi lv7.1 version

thanks

0 Kudos
Message 6 of 8
(5,403 Views)
Not bad, but you should take into account that changing the Panel Bounds, you are affecting mouse coordinates, too, impacting on the subsequent Mouse Move event. This creates a trembling effect. You want the window to follow the mouse, so basically mouse coords should be kept constants after each hop (see the change in case True into Mouse Move).
Second, you may want to switch off tracking when the mouse jumps out of the window, because in this case you are no longer able to track its movement, so I added Mouse Leave to the Mouse Up event handler.
Moreover, I added a timeout just to limit the event processing frequence, but this is not so important and you may want to entirely remove this change. The flaw here is that the longer the timeout, the greater is the probability to loose mouse tracking.
Finally, in my tests the overall effect of this management is to slightly increase the window size. I admit I don't understand this behaviour, so far.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 7 of 8
(5,393 Views)
hi pincpanter
 
thank you very much
 
now i can move window smoothly, as for the window size, it is my mistake, use different properties, one side is "FP.WinBounds", the other side is "FP.PanelBounds", change to same properties, either one is ok, everything will be fine
 
 
0 Kudos
Message 8 of 8
(5,371 Views)