Resize controls programmatically during execution

I have a series of controls on a GUI and a GUI I want to be able to resize according to the machine that is running the program.

Basically, my logic is this. A GUI can fill the available display space, but not all, and must never be directed at a screen that is not designed for.

Currently my laptop is having display problems and keep chaning the resolution thus masking the parts of my GUI.

I want to resize (and place all controls visible and indicators - I know that those to whom they are) so that my GUI appears in a space about some default screen resolutions. (800 x 600, 1024 x 768 and 1280 x 1024)

I can get the position and the limits of control, but I can't change the boundaries of a control (generic) with the property node. It's frustrating. one of my being a listbox controls large multicolumn who takes the largest part of the screen and really need resize according to the resolution of the screen.

Any ideas?

James

Your immediate problem is change the size of a control is available only through specific property (and not generic) nodes.  Use the function "to the more specific" in the palette controls App to convert the reference type.  If the generic reference does not mention this reference type, it will return an error.

Here's the code that changes all MCLs on public Service 100x200px

Since you say that you know who controls that you want to change, you can do created references, too.

Tags: NI Software

Similar Questions

  • IMAQ, zoom to fit display control disappeared during execution.

    As in the title. The menu is impossible to call during execution of the control display Imaq. This has happened after the compilation of the code.

    Any idea why this happened?

    Francesco.

    I had this problem before.

    The solution is not very pretty, but it can be found here: http://forums.ni.com/t5/LabVIEW/Missing-quot-Zoom-to-fit-quot-in-application-EXE-build/td-p/905681

    Birgit

  • Resizing a JButton during execution

    Hello. I have problems with a JButton resizing during execution. I can set the size of a JButton in my JFrame constructor. However, when I try to change via an ActionListener has defined the JButton even nothing happens. I tried to call invalidate() on the JButton and the JPanel that contains nothing will do. Any help to fix this would be appreciated. Below the source code.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    
    public class framebuild extends JFrame
    {
         JButton button1, button2;
         JLabel label;
         JPanel labelPanel = new JPanel();
         JPanel buttonPanel = new JPanel();
         
         public framebuild()
         {
              super("Error");
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              setPreferredSize(new Dimension(300,300));
              setLayout(new BorderLayout());
              setResizable(true);
              
              clickresponse responder = new clickresponse();
              
              label = new JLabel("Resize button?");
              button1 = new JButton("OK");
              button1.addActionListener(responder);
              button2 = new JButton("Cancel");
              button2.addActionListener(responder);
              
              
              labelPanel.add(label);
              
              buttonPanel.add(button1);
              buttonPanel.add(button2);
              
              add(labelPanel, BorderLayout.CENTER);
              add(buttonPanel, BorderLayout.SOUTH);
         }
         
         private class clickresponse implements ActionListener
         {
              public void actionPerformed(ActionEvent e)
              {
                   if( button1 == e.getSource() )
                   {
                        button1.setPreferredSize(new Dimension(100,100));
                        button1.invalidate();
                   }
                   else
                        System.exit(0);
              }
         }
         
         public static void main( String[] args )
         {
              framebuild frame = new framebuild();
              frame.pack();
              frame.setVisible(true);
         }
    
    }

    First of all, a few notes on your code.

  • By convention, Java class names start with a capital letter and the first letter of each internal Word is capitalized. FrameBuild, no framebuild and ClickResponse, not clickresponse.
  • It is usually seen on evil as a diversion from the legacy of needlessly extend a class. Your class could contain a JFrame rather than extend the JFrame.
  • All Swing components should always be created and modified on the EDT and only on the EDT.

    When you make changes that affect the provision of an already visible from container, you must call, ( revalidate() and repaint()sometims) on the container.

    //button1.invalidate();
    buttonPanel.revalidate();
    

    DB

    Edit

  • Avoid the 'standard' listeners who need to identify the source of the event to determine what steps to take. Soon, they develop little handy in any real application.

    Here is the summary of my recommendations, adapted from your code.

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    
    public class FrameBuild {
    
      JButton button1, button2;
      JLabel label;
      JPanel labelPanel = new JPanel();
      JPanel buttonPanel = new JPanel();
    
      public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
    
          @Override
          public void run() {
            new FrameBuild().makeUI();
          }
        });
      }
    
      public void makeUI() {
        label = new JLabel("Resize button?");
        labelPanel.add(label);
    
        button1 = new JButton("OK");
        button1.addActionListener(new ActionListener() {
    
          @Override
          public void actionPerformed(ActionEvent e) {
            button1.setPreferredSize(new Dimension(100, 100));
            buttonPanel.revalidate();
          }
        });
    
        button2 = new JButton("Cancel");
        button2.addActionListener(new ActionListener() {
    
          @Override
          public void actionPerformed(ActionEvent e) {
            System.exit(0);
          }
        });
    
        buttonPanel.add(button1);
        buttonPanel.add(button2);
    
        JFrame frame = new JFrame("Error");
        frame.add(labelPanel, BorderLayout.CENTER);
        frame.add(buttonPanel, BorderLayout.SOUTH);
    
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(300, 300);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      }
    }
    

    Published by: Darryl Burke

  • Rename the text in a cell in the control tree during execution

    Hi all

    In fact, I'm stuck upward at some point. On the photo front, that I have attached, there is a tree control and two buttons (re, stop) .when I press the button rename, I want the selected cell in the tree control to increase and when I get the text via the key board the cell must be renamed. Can anyone suggest me how to proceed?

    Thank you and best regards,

    srikrishnaNF

    Hi guruthilak,

    Thanks for the reply, but I did it in a different way, where I tweaked with a control of the chain. I enclose this VI.

    Thank you and best regards,

    srikrishnaNF

  • Fill the programmatic view object during execution

    Hi all

    I have a requirement to switch between the three different data source during execution in a single page. The user interface and the field names are the same for these three cases, but data from various sources (queries).

    So, imagine that we have 3 objects in view which has implemented read-only (object request depending on the view) and we want to fill a display object at the main performance as a data source for my page.

    My idea is to use "Prgorammatic view object" for this data source and then fill dynamically the contents of one of the three objects view read-only based on a setting in the user's selection.

    First of all, I want to know if it is thin approach and if yes, then get some points on the implementation or any other sample.

    I found this example:

    http://techiecook.WordPress.com/2011/05/17/programmatically-populate-view-objects-in-Oracle-ADF/

    Thanks in advance,

    Nasser

    Hello

    It is more a case of use for Adaptive connections. See:https://blogs.oracle.com/groundside/entry/towards_ultra_reusability_for_adf

    You can use EL to change the name of the ViewObject that an iterator in ADF queries its data. If the switch is on the link layer and there is no need for programmatic view objects. Unlike in the article of the blog above, VO 3 exist in your case then you don't need to create on the fly. Just change the name of VO in the managed bean referenced

    Frank

  • For a control that can be initilaized during execution

    In the case of an enumeration or a constatnt ring. The options to select should be listed when programming

    The option to select is possible during execution.

    I have a table, and I can send the 1st column of values in the menu drop-down, select one during execution.

    Help, please.

    Hi, Mike Grugh,.

    I don't know how to do it with a table drop-down list boxes, but if the number of lines in your file, then you can try the attached example.

    Kind regards

    Amine31

    (Give the congratulations to the right answers and Mark as a solution if your problem is resolved)

  • masking steps during execution

    I have a sous-suite that I point the user to when asked to isolate a card failure.  To give them some flexibility, I got a popup that gives them a certain number of options (see attachment).  I have an m.o. that indicates the individual steps these select/run (i.e. '1' or '3' in the png).  Control flow (denoted by '2') is the noise they don't really need to worry and may / will cause confusion (and possibly problems for me if they select them accidentally).  Is there a way to hide these measures flow during execution control so that the user sees '1' and '2' (and other similar 'valid' selections?

    If there wasn't a need explicit to have the flow control logic, then I'd be tempted to compact all in the post of the Popup Message action.

    By setting the Popup Message Action to go to the step, , use Custom Condition (TRUE):

    And by using the following Expression:

    Step.Result.ButtonHit == 1? RunState.Sequence.Main ["MR_RPack_R55"]. UniqueStepId:
    Step.Result.ButtonHit == 2? "" "RunState.Sequence.Main ["End_PCI_Isolation"]." UniqueStepId:
    Step.Result.ButtonHit is 3? RunState.Sequence.Main ["MR_R103"]. UniqueStepId:
    Step.Result.ButtonHit is 4? "" "RunState.Sequence.Main ["PCI_Intf_PT"]." UniqueStepId: «»

    It should be appropriate level following the Popup Message.

    (SequenceFile attached).

    I hope this helps.

    Charlie

  • Why get error during execution the FPGA VI?

    Hello world

    I have a lot of sense of wrong during execution of a program that has been correctly executed previously. I don't know what I did wrong.

    Now, whenever I run this FPGA VI, I get an error (in the attachment). And, then runs the FPGA VI, but it does not give the data required those he supposed to give as output.

    Any help or recommendations would be appreciated also.

    Thank you.

    Hi auree123,

    There are a few reasons for this error
    may occur.  Could you tell us more about what's going on?

    You are
    I get this error when you compile and if so, at what stage?

    It looks like
    as you may be running it in Interactive Mode, which means that you are viewing
    the front of the FPGA VI on the development computer that you are running - is
    that correct?  If so, you could try to create a VI on your host
    Open a FPGA reference and communicate with the FPGA programmatically rather than interactively.

    Thank you

    Morgan S

    Technical sales engineer

  • Edit/delete/add scene coordinates in the table during execution

    Hello world

    I managed to build table allows you to store and record the coordinates of the stage and remind to control steps. However, I need change/remove/add details of scene during execution. I also need to allow the user to directly edit the coordinate from the scene of the array. Wondering what someone knows what is the best way to do it? Or is it better to use the matrix or Cluster? Thanks in advance.

    Best regards

    Han Yen

    Han Yen wrote:

    Thanks much altenbach for all the advice. I tried to do a table 2D control. I've been playing with table in the control. However, I still can't find out how can I detect that I change the data in the table 2D with the more recent issue during execution? How can I then update my current table with the latest data?

    Well, the 2D table is updated immediately and you do not all the other tables.

    Do you mean that you want to update XAbs, etc. where the just changed line is already selected?

    In any case, here's a simple project, perhaps it will give you some ideas. I would recommend using also the tables for XYZPos, entrances etc. and the XYZabs. This simplifies the code because you reduce the number of terminals and table operations.

    Let me know if something is not clear to you.

  • Disable the extended FIFO FPGA target during execution

    Hello

    I use a FIFO extended target in my FPGA to constantly calculate the derivative of a measured value (dB/dt). Thus the FIFO stores all values during time dt. This means dt determines the number of items in the FIFO and dB is determined by the actual value less the oldest value in the FIFO. It works well when I initialize with the code in figure InitFIFO.

    But the FIFO of compensation is not possible (see figure clearFIFO). In the while loop if "reset dB" is false, as the new value of B is written on the FIFO, then the oldest value is read from, for the number of items in the FIFO remain constant. To change dt during execution, I need to clear the FIFO and initialize it with a new length (number of items). I tried the next loop, but it does not work. The FIFO does not initilized with the elements. The length is zero and the loop counter for (#deltaB Length2) is 0.

    What I am doing wrong? Is there a better way to erase a FIFO during execution in the FPGA? I'm now stuck for 2 days with this problem and looking forward to any idea or suggestion.

    Thank you very much. Best regards

    Andy

    Hej,

    Thank you for your response. You were correct, that deltab FIFO length was 0 because the defalt value was zero. The problem is that in my host vi on the RT system I put DeltaB FIFO length in a loop of high priority and as you can see when I restart the FPGA, DeltaB FIFO length has a valid value (the code in figure 1 works well with a local variable of DeltaB FIFO length in the FPGA). But the variable to set the variable "reset dB" is under the control of the loop of low priority of the host vi. And there, I had an entry DeltaB FIFO length unwired.

    So, I learned that a control FPGA read/write unwired sends a '0' or resets the variable to its default value in the FPGA. I assumed that nothing is transferred and the last variable is retained if you let a control read/write unwired. Now, I learned of this stupid error!

    Thanks a lot again!

    Andy

  • modify VI during execution

    Dear users of LabView,

    I have a fairly general question about the development of a project, which requires a continuous control of the material. To be more precise, I develop LabView control and DAQ software for calorimeters in high volume in the last 2 years. Such a system requires several PID controls, and it has many subsystems. Because of the large heat capacity, it takes about 3-4 days to launch the system. So if I need to edit for example something in control of the final of a specific subsystem, I stop the LabView code, I have change the specific part, I restart the system, I wait for 3 days, and then I can see the result of my changes.

    My question is the sort of General: what is the good, let's say "best practice" to avoid such a dead time?

    Is it possible to change a VI during execution?

    I understand that if I run the independent screw, that dealing with subsystems, I could avoid this problem. But if I already have a compact 'main' VI, including all the subVIs, what can I do?

    It would be nice to have a sort of "hot swapping" feature in LabView, so during the execution of main VI of my project, I could change the Subvi that I want, and when it is ready to activate, the runtime would swap with the old version.

    Thanks for the tips and advice!

    Best wishes

    Hello

    It all depends on how works your vi...

    The only way I see is to use dynamic calls: a vi called dynamically is editable even if appellant vi is running.

    If you change the callee until the caller calls the vi vi.

    Is how the appellant under vi (this includes the values of connectors and run the VI):

    Best regards

  • How to change the frequency of sampling DAQmx during execution?

    Hello guys. I'm using LabVIEW in the measures of the frequency response function. My application requires the sampling rate to change according to the frequency of the signal during execution.

    I tried to do it with a "structure of the event" and it works well when I change the rate manually via the front control but it backs do not work when I set up the sampling frequency to vary automatically (just a frequency sweep). Photos below:

    Why not the structure of the event feels the change in the value of "rate"?

    Thanks in advance for your help.

    Lucas

    Hello

    In "automatic mode" to change the sampling rate, the calculated rate is written in the local variable (as illustrated in the code).  Structure of the event does not change value in the local variable as an event.

    In order to make the structure of the event to recognize the change in value of an indicator such as event: write the new value to the property "Value (Sgnl)" corrosponding node to rate indicator (see figure below).  This will make the structure of the event accept the value change in the indicator as event.

    Note: Use architectures such as producers and consumers for such applications, which makes the application readable and expandable.

    See rear queries if any.

  • to make a transparent image control programmatically

    I can make a picture transparent control prior to execution, and it works fine.

    I just can't seem to be able to do it programmatically


  • change the frequency of the signal during execution

    Hi, I'm working on a VI to calculate excess of signal I think VI seems to be good (not sure) but now my problem is

    change the frequency during execution, which I am not able to do only when I stop and run the vi frequency changes... pls

    someone help me I tried to put in an event... but no use... maybe iam missing something pls help me...

    I noticed that you have some time a loop around the entire block diagram - I'm not entirely sure why that is.  The way you have your VI wrote that the two inner loops will never come out unless there is an error-'stop' buttons are hidden.  Thus, the outer loop is not do anything for you.

    Once you take it, it is easy to see why you cannot change frequency.  It is defined once, outside of the loops and so never gets checked again.  The best way to resolve this, in your case, is to use registers with shift on the upper loop and check if the value of the frequency has changed since the last iteration.  If so, generate a new waveform and feed DAQmx writing instead.

    See the version annexed to your main VI for what I mean.  (I also replaced the controls to stop with one that is visible and which will stop the two loops without your duty to hit the button abandon.) I'm also an error on the DAQmx read in the loop at the bottom, but I'm sure it will work fine on your equipment.

    See you soon,.

    Michael

  • During execution of the backup and maintenance on one of my computers, I noticed a folder and the file that I can't identify me...

    Original title: identity of unknown folder

    During execution of the backup and maintenance on one of my computers (Windows xp home, sp3), I noticed a folder and the file that I can't identify.  The name of the folder is cc68f6b7a7ca948eefb018f001 and the name of the update.exe file.  The properties of the file that it is a Windows Service Pack installation.  I tried Googling the name of the folder, but found nothing.

    Can you tell me with regard to this issue, and what, if anything, I have to do?

    Thank you.

    When some programs (including Windows) installs things, it can create a temporary folder composed of 20-30 random letters and numbers or random numbers and letters in the root of the drive of the volume with more free space.

    This explains why the records are sometimes on your C drive or any other drive - the most space?

    For example, you can see a similar to or called folder:

    D:\9470bb12e8a4f3447657236478e41c5

    There may be other folders and files in this main temporary folder such as amd64 and i386 platforms.

    They should normally be deleted when the installation is complete, but sometimes they are not - especially if the installation fails.  They are harmless but annoying.  You can think something is wrong when there are no or fear, that the files are really necessary.  To avoid confusion, you can delete the temporary files.

    If your installation has failed or the installation does not remove the folder to the random name when it finishes running again installation will be another folder at the random name.

    You may be able to identify installation (out of curiosity) by looking at some of the contents of the folder and decide if this installation was not serious, just remove the files/folders.  If the installation does not work for some reason, run again just installation will create a new temporary folder to the random name so the old temporary folder is really useless.

    Records are sometimes tough to remove.  Even if you are an administrator on the system, you might get a "sharing violation", "access denied", "used" or type similar message when you try to delete temporary folders.  Facilities sometimes use different permissions that can have a regular user with the administrator group.

    There are many methods to try to remove the folders, and some require third party programs to install or change some windows settings that could compromise the security of your system if you do not change them back when you're done.

    Start your system in Mode safe mode (by pressing the F8 key several times just before XP attempts to load) is one good method to try to remove the files because it does not have to make any changes to your system configuration or by downloading third-party programs.

    If you are running XP Home Edition, the following section on turn off "Simple file sharing" does not apply to you since in XP Home, Simple file sharing is always turned on.  If you are running XP Home Edition, skip the next few paragraphs and resume where it says:

    "If no part tool above work try a third popular called Unlocker.

    If Safe Mode does not work you can change the security of the folder when you start in Normal Mode to give your username full control over the files by navigating to it in Solution Explorer, click on tools, Folder Options, view and in the advanced settings window, uncheck (at the bottom of the list) use simple file sharing (recommended) and click OK.  This disables him recommended simple file sharing on your computer if you want to turn it back on when you're done to make everything you do.

    Right-click on the files of interest, click Properties and click the now visible security tab.  Change the properties, but you need (for example, select your user name, and check the box to allow full control), click OK to apply the changes.

    With usage share of active simple files (recommended) the checked the properties of the folder tabs are:

    General, sharing, customize

    With the use of sharing files simple disabled (recommended) box unchecked, the properties of the folder tabs are:

    General, security, customize

    Now, try to manipulate/delete the folder.

    It's a good idea to go back to the Explorer and the cheque in the box easy to use sharing files (recommended) when you have finished making everything you do.

    If none of the above works, try a popular third-party tool called Unlocker.

    Unlocker can be downloaded here:

    http://www.emptyloop.com/Unlocker/

    If you use Unlocker, be sure to install because he wants to add a bunch of options, addons, shortcuts and other extras that you don't need.

    You must add the shell extension so when you right click on the offending file, you will have a Unlocker option to choose.  I would just install it long enough to clean up the leftovers and then, I usually just uninstall and all parts of it.  You can always install it again another day if you like.

    Unlocker can be uninstalled when you have finished using it.

    Reboot when finished to ensure that boring records are really missing.

Maybe you are looking for

  • Installs Java, but is not detected

    I am installing Java on my computer and once it finishes the installation, there will be no check on their site, and all sites that check Java say that it is not installed. I see it in my page plugins, but after I uninstalled it to try something in t

  • How can I customize action keys?

    I'm working on a G62 - 320CA who has five actions keys on the left side (mail, media, web browser, print and Calculator). How can I customize these? They do not open programs. Thank you Shane.

  • the collapse / resize the toolbar to normal size

    How can I minimize / resize the toolbar to normal size? Woke up to a bunch of open windows and toolbar extended to take 20% of the screen. Thank you for you and wanting to be good for you

  • Why ink snapshot?

    So I got a new HP printer about a year ago.  I signed up for InstantInk.  We got a box of cartridges, shortly before the small cartridges that came with the computer was missing.  Load us them into our printer. We used the printer, and we paid the mo

  • Impossible to click on the buttons for the timed loop.

    Hello! I have a loop that is timed with a pace set by the user. And when the loop is running, I can't push any button of my GUI to stop it... I have to wait until a mistake or I stop the race. I can't put the diagram is too big and I think I don't ha