Gepponline Posted June 10, 2021 Report Share Posted June 10, 2021 Hi, is it possible to create and resize a button in a running vi's front panel? I would like for example to place a square button where I press mouse down and then, if I drag left and right borders, resize it. I've done something similar in the past using images, but this time I need buttons to be single objects I can move in a second time Quote Link to comment
ensegre Posted June 10, 2021 Report Share Posted June 10, 2021 You can do something along these lines trapping mouse events. The quick example is all but polished, but should give you the general idea. clickbutton.vi Quote Link to comment
jcarmody Posted June 10, 2021 Report Share Posted June 10, 2021 I'm nearly certain that you can't create a new control in a running VI, You can make hidden buttons that you show/position/resize. Quote Link to comment
dadreamer Posted June 10, 2021 Report Share Posted June 10, 2021 You also can create the buttons in run-time with the means of .NET - the basic example is here (of course, you need to attach the event callback (handler) to your button(s) to be able to catch the button events). Quote Link to comment
hooovahh Posted June 10, 2021 Report Share Posted June 10, 2021 Yes there is no real native solution for this. NXG did tease a dynamic control creation but I'm not sure it made it far into development. Depending on your needs I would suggest different solutions. I have accomplished similar functions with picture controls in the past for creating a dynamic ribbon interface. Here a running VI can generate an image that looks like a set of group buttons, and tabs and allows for setting of various background colors. Another less polished solution revolves around parent and child relationships of windows, and dynamically running VIs. I called this the Multi Panel Interface and honestly it didn't make it pas the proof of concept phase. But for simple stuff, and a finite set of controls, you're probably better off just having the controls, then showing or hiding them as needed. 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.