LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI front panel title font

Is there a way to programmatically change the font in the title of a VI's front panel?

I've had a bit of a search on the site but can't find anything.

0 Kudos
Message 1 of 5
(2,398 Views)

My guess would be no since a Window's title would be defined by the operating system settings.

0 Kudos
Message 2 of 5
(2,375 Views)

Possible? Sure.

 

With reasonable effort? No. (Depending on what's reasonable to you of course).

 

I have an application that is completely 'skinned'. Custom borders, title bars, buttons, etc. You'll have to do everything. I can't just post that here, sorry about that. It's a complex mix of complex scaling and calling Windows APIs at the correct time. Not easy, and honestly not perfect either.

 

Another way would be to (in a dll) hook the winproc, and do non-client painting... Also not easy.

 

There are other options, like embedding front panels in .NET forms. And then customizing the .NET form of course. Never got that working reliably, but I heard it has been done.

0 Kudos
Message 3 of 5
(2,353 Views)

Well, thanks to both who replied. I had an idea that it would be the case that it's not easy!

Not really an issue, but it just jars on me when everything else is in a different font, but I can certainly live with it.

Especially as the client doesn't care!

0 Kudos
Message 4 of 5
(2,315 Views)

MS's justification of this being hard is that the title bars can be changed by the user if they want to. As a programmer, you should respect that choice, and not change it. Of course all of MS's applications modify the title bars with buttons, images and what not... 

 

There are 3rd skinning applications that claim to do this. I've glanced over them when searching for a solution. Of course LabVIEW not being C\C++ doesn't help, often it comes down to catching windows messages and changing the winproc.

 

I started out with a solution that involved a border and title bar-less VI. Then I drew all the custom borders and title bars in there. This first attempt involved catching mouse move events, and when the user hovered over a border or title bar, I'd overlay a 99% transparent VI over it. So the user would unknowingly move\resize that VI instead. When he did, it would send events to the real VI. That worked OK-ish.

 

I now still do the drawing myself, but use WinAPIs to fool Windows. So when the user presses the titlebar, I send a message to signal Windows the user clicked in the title bar. Windows falls for that, and moving the mouse moves the window. That one is easy. Double clicking, right click menu's on the title bar, etc. are a bit harder. In general, it is virtually impossible to get a resizable window that has no borders. In Window 10, those borders are a glow, so it goes mostly unnoticed. But the moment the windows real title bar is hidden, you get this white bar above the window. Also virtually impossible to remove that. The only option is to do all the resizing manually. That includes catching mouse movements and changing cursors. I decided to live with the glow and white border...

0 Kudos
Message 5 of 5
(2,305 Views)