LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Window bounds property not working properly

Solved!
Go to solution

Hello everyone,

 

please explain this behaviour to me: 

Why is there a gap on the left side? It is driving me nuts.

image.png

Update: Works as expected in windows 7. No gap on the left side.

 

labview.PNG

0 Kudos
Message 1 of 7
(1,016 Views)

Looks like a Windows issue.  Different scheme.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 7
(997 Views)
Solution
Accepted by topic author ImreSzebelledi

Thanks for the reply! After digging around it really is a windows 10 theme issue. By editing the windows metrics in the registry you can get better results but it won't go completely away. Really annoying but not a labview bug.

0 Kudos
Message 3 of 7
(960 Views)

Do you have links to the info you found about the theme issue, or the specific registry keys? Might be useful for the next person who comes across this Win10 issue.

0 Kudos
Message 4 of 7
(929 Views)

The semi transparent drag border counts as window bound (8 pixels usually, IIRC). If you make the window non-resizable, you'll get better results.

0 Kudos
Message 5 of 7
(925 Views)

Unfortunately even if i make it non resizable and set the registry values (\HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\BorderWidth      ..\PaddedBorderWidth to 0 there is still a few pixel gap. But it really does help so thank you. I will have to put a few pixel correction into my program.

0 Kudos
Message 6 of 7
(917 Views)

Instead of changing that registry value, you can (try to) read the border width. GetSystemMetrics does this, with SM_CXBORDER (5) wired to it.

 

Once you have that value, simply subtract it from the rectangle's left, add it to i's right coordinate.

 

Trying to make it 0 is a battle you'll probably lose. And as all windows are affected, it's not really nice to users.

 

I think making a window a child of another window will also remove the border. Maybe you can elaborate a bit on the use case?

0 Kudos
Message 7 of 7
(910 Views)