08-13-2010 07:52 PM
Is there an easy way to limit panel resizing to a single dimension? That is, can I make a front panel that allows resizing the HEIGHT but not the WIDTH?
What would be nice is if there was a way to set the "VI Properties>>Window Size" MAXIMUM size along with minimum (default to <Inf>). But I would settle for a programmatic way to do it, too. I tried making a UE to catch the <Panel: Resize> event, and replace the "Left" and "Right" bounds of the NewBounds with those of the OldBounds, but that ended up doing some wonky stuff.
Anyone out there found a solution for this problem?
[I should add, I'm still running LV 8.6.1...maybe this has been addressed in later versions?]
08-14-2010 02:12 PM
I'm pretty sure that there isn't, as I don't think Windows supports it and resizing windows is presumably handled by it.
If there's a window message associated with the resize, you might be able to intercept it using some platform-specific code, but that's beyond the realm of my own experience.
One thing you can try to do is disable the resizing completely and then add your own resizing logic and code (such as buttons near the edge which will expand or compact the UI by X pixels). I think this is what you usually see in programs which allow expanding in only one direction (although usually the buttons expose an entire pane at once).
08-14-2010 02:24 PM
Look at this thread.
12-28-2025 08:33 PM
Replying to this thread 15 years later...
Yes, on Windows, it is possible to limit panel resizing to a single dimension. With major assistance from Grok, I built a Windows DLL for that purpose. Unlike LV-based solutions, it's a clean solution that does not cause any panel flicker or snapback. Tested in LabVIEW 2023 64-bit on Windows 11. If anyone is still around and still interested, let me know, and I'll elaborate.
12-31-2025 06:52 AM
I’d love to hear more details about how the DLL works and how you’re integrating it with LV.
12-31-2025 04:00 PM
I have attached the DLL, a wrapper VI, and a test VI with instructions. The DLL is 64-bit; the VIs are written in LV 2023 (64-bit). The DLL was built in Visual Studio 2022.
I've also included the C source code for the DLL. It was written in "vibe" fashion, meaning that I have no idea what it does: it was written entirely by Grok, with some leading and clarifying prompts from me. Keeping up with the times, not only do I not understand how it works, but, to be honest, I don't even care...
From my experience, a fair warning: collaborating with Grok is sobering and humbling!
Happy New Year to everyone!
12-31-2025 09:27 PM
Thank you, Sergey, for attaching the code that you and Grok worked out. Would it be too much to ask if you could embed your Demo, embedding the two VIs and the DLL in a LabVIEW Project, and include Build specification that makes a stand-alone Test LVresize.exe (I must confess that while I'm pretty good at writing LabVIEW to run by running the MAIN from within the Project, I often rely on a colleague who is much more familiar with Builds and Installers than I am).
I have a little familiarity with C, but for now, am content to "admire" Grok's code. It might be fun to understand what the Windows functions he uses, but then again, maybe not without someone who understands Windows internals more than I.
Bob Schor
01-01-2026 11:41 AM
Bob, I don't think it's worth it to create a project and build specs around one very basic demo VI. But if you, or anyone else, want to try one-dimensional window resizing in a standalone application, have a look at my program "Airplane! SnV". Its UI supports horizontal-only window resizing, although its main goal was to demonstrate speech recognition, voice synthesis, and IMAQ-less image acquisition. You can find it here.