How do I position a window dynamically?

I want my customized "Get Serial Number" vi to be in one of two positions on the screen.  How can I get the system screen metrics so I can determine the (top,left) coordinates of the vi window, and set the position of the window within the vi?
Thanks,
Mike
Solved!
Go to Solution.

If you are using a PC, the screen size can be found using the .NET Property Node under Systems.Windows.Forms.SystemInformation.PrimaryMonitorSize
You can move the vi front panel using a property node with a reference to 'This VI'.  I have enclosed a not-too-elegant yet functional example.  Hope this helps.
-Darin
Message Edited by Darin.K on 07-16-2009 06:55 PM
Attachments:
MoveMe.vi ‏15 KB

Similar Messages

  • How do you position a window on the screen?

    When I run a application how do I make the window open in the middle of the screen instead of the top left?

    Ah, a JFrame, then try this;-
       Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
       Dimension frameSize = frame.getSize();
          if (frameSize.height > screenSize.height) {
             frameSize.height = screenSize.height;
          if (frameSize.width > screenSize.width) {
             frameSize.width = screenSize.width;
      frame.setLocation((screenSize.width - frameSize.width)/2,(screenSize.height - frameSize.height)/2);
      frame.setVisible(true);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • SAP Script :change position of window margins (resize window)

    Hi,
    how to change position of window margins (resize a window)?
    Sounds very simple, but when I open my SAPScript form in layout editing mode it does not allow me to change values of window margins...
    Regards,
    Mindaugas

    Hi...
    Make sure your entering language and orginal language of the script is same or not.
    utilities -> convert orginal language..
    Procedure if you are using English as entering language:
    Enter script name -> Enter language as DE -> change -> utiliteis -> convert orginal language -> change it DE to EN -> now back and re-enter into script...
    Thanks,
    Naveen.I

  • How to call a window dynamically from a view

    Dear forum experts,
    I am developing an application where i have  4 view controllers and 2 window controllers under one component.Some times on click of a button i have to give a provision to switch to another view from one view, which i did by firing the plug to the corresponding view..
    Now i have a requirement where, on click of a button i have to navigate to the window dynamically which would contain some static views,
    Can some one please suggest me how to go about it.
    Thanks.

    Hi,
      You can raise the window as a pop-up.
    Example.
      DATA lo_window_manager TYPE REF TO if_wd_window_manager.
      DATA lo_api_component  TYPE REF TO if_wd_component.
      DATA lo_window         TYPE REF TO if_wd_window.
      lo_api_component  = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
      lo_window         = lo_window_manager->create_window(
                         window_name            = 'ZWIN2'
                       title                  =
                       close_in_any_case      = abap_true
                         message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                       close_button           = abap_true
                         button_kind            = if_wd_window=>co_buttons_ok
                         message_type           = if_wd_window=>co_msg_type_none
                         default_button         = if_wd_window=>co_button_ok
      lo_window->open( ).
    I am not sure how to navigate to a view in a different window using plugs.
    I raised the view as a pop up in my requirement.
    Cheers,
    Aditya.

  • Smartform problem how to make second page main window dynamic?

    Hi SAP Community,
    I am facing a problem with designing a smartform. I have taken a table in the main window of the first page, and the main window length varies according to the number of entries in the table. If the records are more than that can be adjusted in the first page then the ramaining records move to the second page main window. After the second page main window i have defined a window which i have marked to get displayed after the main window, but the problem i am facing is that that the second page main window is geting overlapped with the window defined to come after it. Can any one help me with how to control the length of second page main window dynamically.
    Regards,
    Tushar

    Hi,
    Normally, to trigger next page the main window is mandatory.
    However, if the contents of main window are not sufficient enough to move over to next page then the next page would not get trigerred.
    Moreover, please check whether the table of contents in the first page are also existing in the next page otherwise you need to trigger a new page by using a command.
    Also please direct the next page of SECOND page to SECOND itself and check.
    Regards,
    Ram

  • How can I make Mail window positions sticky?

    One of the few good things about Windows is application windows always open in the same place every time. Why can't we have this with Apple Mail...it occurs with many other inherent Apple applications.
    When I open a new message window in Apple Mail I don't want it to be in a different position every time I open it...I want it in the same spot each time (and want that position to be decided by me...I'm the one using the application). Forcing a window to open in the same position is basic programming, so this must be something intentionally done. Is there any way to fix it?
    LarryMcJ
    iMac 24   Mac OS X (10.4.8)  

    One of the few good things about Windows is
    application windows always open in the same place
    every time.
    Pull the other one. (Or did I miss the smilies? ...
    But back on track:
    When I open a new message window in Apple Mail I
    don't want it to be in a different position every
    time I open it...I want it in the same spot each time
    Hi
    Mail is a document-based application (that is developer speak - never mind) that automatically stores the size and position of windows (at least it should).
    BUT it differentiates between the type of windows you are using - example:
    - Mine is configured to show no preview pane (just the sidebar with accounts and folders and the message list on the right)
    - When I compose a message it opens in the exact same location where I had the last message composed and send (that is it stores size and position of the composition window)
    - When I read a message it opens in the exact same location where I read the last message.
    The two window positions can be different...
    If this does not work for you then I suggest a look at the pref file for Apple Mail.
    It lives in /User/[short user name]/Library/Preferences/ by the name com.apple.mail.plist.
    You should only modify this file when Mail is NOT RUNNING. If I open several mail message windows and toss them around size and position get stored immediately in that file.
    Unfortunately there is no way to store size and position in that file permanently - you could lock the file but this is not a good idea for Mail will complain about missing rights and stop working.
    Cheers,
    Walter

  • How to use Two main windows with in a page in script ?

    Hi any body explain me...
    How to use Two main windows with in a page in script ?
    with  header data in one main window,
    & Item data in other main window.

    HI..,
    u need to go for <b>SPLITTING THE MAIN WINDOW</b> !!!
    Main windows in page windows allow you to format text in multiple columns. Define an area in the page window, in which to position the main windows.
    Here is the procedure !!
    -->Create a page window and assign it to a page.
    Choose <b>Edit --> Main windows</b>.
    A dialog box appears.
    -->Enter values in the fields <b>Area width</b> and A<b>rea height</b> in accordance with the input guidelines for main windows.
    -->Enter values in the fields <b>Spacing</b> and Number in the <b>Horizontal group</b> if you want to use multiple columns. You can ignore the fields in the Vertical group.
    Determine how many columns and line areas are required for label printing. Then enter the corresponding values in the fields in the <b>Horizontal and Vertical groups</b>.
    -->The value in the field Left margin varies from main window to main window if multiple columns are used. The following applies:
    <b>
    Left margin of current column + Window width + Horizontal spacing = Left margin of next column</b>
    In label printing, the field Upper margin also varies from main window to main window:
    <b>
      Upper margin of current main window +  Window height + Vertical spacing = Upper margin of next main window</b>
    -->Enter a value in the field Start position.
    This is a counter. Enter a starting value which is equal to or greater than 1.
    -->The main windows are added to the list.
    -->Save your form.
    reward if it helps u...
    sai ramesh

  • How to use Different Main Windows in Multiple pages to print internal table

    Hi experts,
    I have a problem regarding how to have multiple different main windows in  smartforms..the problem is that i want to print an internal table in the third page of the smartform and that table can have dynamic values ..sometime it may have more than 400 values also which can not be printed in one or two pages ...
    so to accomplish the same what i did was..
    i tried creating a new main window in the third page but it is throwing an error saying two main windows not allowed and i also tried by copying the first page's main window but it is just repeating the same content what was there in second page..
      i also tried by creating a secondary window in the third page and in that  window i tried giving my internal table and tried by giving the next page to itself but  that also is not allowed and it throws an error saying a page without a main window cannot point to itself as a next page....
    i also tried using a secondary window and in that window i was trying to display the internal table but it is only showing third page content and fourth page itself  was not created....although in my next page field value of the third page , i have given  the third page itself as a next page ....but this also is not working ,.....
    please suggest how to have different main windows(not copy of first main window) in smartforms in order to display the dynamic contents of an internal table

    HI ,
    Just check with your smart styles with assigned  paragraph  allignment   .
    Try to create character style  with your required  font ,size and  Allignment  .
    Hope u this will solve your issue  .
    Let me know if any concerns......
    Regards,
    Lokesh

  • Simple how-to guide to adding windows 7 64-bit to mavericks as a virtual machine (Virtual Box)

    Simple how-to guide to adding windows 7 64-bit to mavericks as a virtual machine (Virtual Box)
    Why use a Virtual Machine: Sometimes you need to run a windows only program.  A VM lets you do that without rebooting your machine. 
    How is it different from Mac Boot Camp: Boot camp allows you to run windows but you must reboot your machine. It is faster and smoother than a VM (and with fullscreen details below), but you have to reboot for each use. 
    Is it possible to have a VM and Boot Camp: Yes, and I do this because sometimes I want to use a VM quickly without shutting down, sometimes I want the advantages of Boot Camp
    How do I get Windows in Boot Camp: how-to here:
    https://discussions.apple.com/thread/6025059
    *Please note I accept no responsibility for issues occurring from the use of this guide, please use at your risk
    **Please note I do not propose or support using illegal copies of Windows software or licenses
    Required technical skill: minimal
    Required time: approx 30 minutes
    Required items: Mac
    Get a version of Windows 7 64-bit:
    http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_install/canno t-find-digital-river-download-site/66a8439b-0d16-4b70-92f7-1c8486a46ebf
    Windows 7 Downloads are still available.
    Download the appropriate Windows 7 .ISO file which includes Service Pack 1 &#8232;(Note: must match what your product key version is for)
    Windows 7 Home Premium 32Bit: http://msft.digitalrivercontent.net/win/X17-58996.iso Windows 7 Home Premium 64Bit: http://msft.digitalrivercontent.net/win/X17-58997.iso
    Windows 7 Professional 32Bit: http://msft.digitalrivercontent.net/win/X17-59183.iso Windows 7 Professional 64Bit: http://msft.digitalrivercontent.net/win/X17-59186.iso
    Windows 7 Ultimate 32Bit: http://msft.digitalrivercontent.net/win/X17-59463.iso Windows 7 Ultimate 64Bit: http://msft.digitalrivercontent.net/win/X17-59465.iso
    Locate your image (iso) file, example: /Users/Christoper/Downloads/X17-58997.iso.download/X17-58997.iso
    Download Virtual Box Virtual Machine Player:
    https://www.virtualbox.org/wiki/Downloads
    Install Win 7 OS:
    Open Virtual Box
    Choose “New” (Note: Once you click new it will require you to complete the process of creation, no option for quit.  If you make a mistake or are not ready, just finish it and then remove it and delete all files)
    Name: “Windows 7 Virtual” or as you choose
    Type: Microsoft Windows
    Version: Windows 7 64-bit
    Memory: I suggest 1GB if you have 4GB available, 512 MB may run slowly.  2GB+ of 4GB may slowdown your MAC OS running while the VM is running. 
    “Create a Virtual Drive Now” option
    File Size: 25 GB should be the minimum selected, I used 25GB because I expect to use the drive to store very little. 
    HD type: VirtualBox Disk Image
    Storage: Dynamically Allocated
    Locate your new VM and click Start (again you will not be able to quit once you start, if you make a mistake continue until the red quit icon appears then remove the VM)
    It will ask you to select the files for the OS.  Select the ISO file, for example: /Users/Christoper/Downloads/X17-58997.iso.download/X17-58997.iso
    Proceed to setup Win with your preferences
    Type product key from your OS purchase or an existing one that you are moving from another machine
    Note: Screen resolution may be very limited on the virtual machine.  I use resolution 800 X 600 so that all of the desktop is visible. 
    I suggest using a windows gadget to view the CPU and Memory usage > On desktop mac-right-click i.e. separate fingers and click both > Gadgets > CPU Meter
    Enjoy having Windows on your Mac!

    I have found a solution to the screen being smaller in the windows 7 virtual machine.  First right-click in the desktop region and select screen resolution.  It is probably set to 800 X 600 by default which is much less than the screensize you are using.  To determine your native screensize, go to your mac and finder > applications > utilities > hardware > graphics displays.  Mine is 1440 X 900 for macbook air.  Then go back into the virtual machine and sceen resolution settings.  Choose a screen resolution which is slightly less in all dimensions so that there is no clipping and you do not have to scroll when viewing.  For me this was 1152 X 864.  Then exit saving changes and with the VM in view press command - F (or at the menu bar View > Switch to full screen), which puts you in full screen mode.  Now you should have a screen with minimal gray empty space filling the majority of your screen

  • Subject: How to get a rolling window  query of last 12 months?

    Subject: How to get a rolling window of last 12 months?
    I am developing a report on 0TCT_C21. I want to compare process chain execution time for every month for last twelve months to see a trending report.
    How can I determine this information dynamically, i.e., when report is run, let us say in Dec 2009, it will show me 12 columns: Jan to Dec 2009, but if report was run in Dec 2010, it will show   12 columns results from Jan to Dec 2010.
    Any information will be greatly appreciated.

    Hi,
    Keep offset value-1, -2, -3, ... -11 for 0Calmonth.

  • Why does the content spill over and how do I position this under the menu and title?

    I was following this tutorial on how to add a scrolling image gallery to a Flash website.
    (http://www.republicofcode.com/tutorials/flash/xmlimagegallery/index.php)
    From what I understand from this tutorial, it is just a matter of copying the Actionscript code and pasting it onto the timelines then making modifications on the XML.
    (kindly see a screenshot of timeline layers I made and as to where I put the Actionscript code:
    http://i429.photobucket.com/albums/qq19/tsujzpie/imagegalleryproblem_01.jpg )
    I pasted the code onto the blank keyframe labeled "Gallery"...
    But all I get is this weird effect when I click on the button for the gallery...
    (kindly see a screenshot of it here: http://i429.photobucket.com/albums/qq19/tsujzpie/imagegalleryproblem_02.jpg )
    When you put a blank keyframe on a timeline, any content put in there is supposed to only be contained in that very frame, right? How come then that - whenever the gallery button is clicked on - the content from that section spills out onto the other sections even when I click on other button for the other areas?
    I just really couldn't think why this is happening - any reason why this is so?
    And how do I position the gallery right under the section header and menu bar?
    Here is its AS2 code, by the way:
              import mx.transitions.Tween;
              import mx.transitions.easing.*;
              var myGalleryXML = new XML();
              myGalleryXML.ignoreWhite = true;
              myGalleryXML.load("gallery.xml");
              myGalleryXML.onLoad = function() {
                        _root.gallery_x = myGalleryXML.firstChild.attributes.gallery_x;
                        _root.gallery_y = myGalleryXML.firstChild.attributes.gallery_y;
                        _root.gallery_width = myGalleryXML.firstChild.attributes.gallery_width;
                        _root.gallery_height = myGalleryXML.firstChild.attributes.gallery_height;
                        _root.myImages = myGalleryXML.firstChild.childNodes;
                        _root.myImagesTotal = myImages.length;
                        _root.thumb_height = myGalleryXML.firstChild.attributes.thumb_height;
                        _root.thumb_width = myGalleryXML.firstChild.attributes.thumb_width;
                        _root.full_x = myGalleryXML.firstChild.attributes.full_x;
                        _root.full_y = myGalleryXML.firstChild.attributes.full_y;
                        callThumbs();
                        createMask();
                        scrolling();
              function callThumbs() {
                        _root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth());
                        container_mc._x = _root.gallery_x;
                        container_mc._y = _root.gallery_y;
                        var clipLoader = new MovieClipLoader();
                        var preloader = new Object();
                        clipLoader.addListener(preloader);
                        for (i=0; i<myImagesTotal; i++) {
                                  thumbURL = myImages[i].attributes.thumb_url;
                                  myThumb_mc = container_mc.createEmptyMovieClip(i,           container_mc.getNextHighestDepth());
                                  myThumb_mc._y = _root.thumb_height*i;
                                  clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);
                                  preloader.onLoadStart = function(target) {
                                            target.createTextField("my_txt",target.getNextHighestDepth          (),0,0,100,20);
                                            target.my_txt.selectable = false;
                                  preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
                                            target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
                                  preloader.onLoadComplete = function(target) {
                                            new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
                                            target.my_txt.removeTextField();
                                            target.onRelease = function() {
                                                      callFullImage(this._name);
                                            target.onRollOver = function() {
                                                      this._alpha = 50;
                                            target.onRollOut = function() {
                                                      this._alpha = 100;
              function callFullImage(myNumber) {
                        myURL = myImages[myNumber].attributes.full_url;
                        myTitle = myImages[myNumber].attributes.title;
                        _root.createEmptyMovieClip("fullImage_mc",_root.getNextHighestDepth());
                        fullImage_mc._x = _root.full_x;
                        fullImage_mc._y = _root.full_y;
                        var fullClipLoader = new MovieClipLoader();
                        var fullPreloader = new Object();
                        fullClipLoader.addListener(fullPreloader);
                        fullPreloader.onLoadStart = function(target) {
                                  target.createTextField("my_txt",fullImage_mc.getNextHighestDepth          (),0,0,200,20);
                                  target.my_txt.selectable = false;
                        fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
                                  target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
                        fullPreloader.onLoadComplete = function(target) {
                                  new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
                                  target.my_txt.text = myTitle;
                        fullClipLoader.loadClip("full_images/"+myURL,fullImage_mc);
              function createMask() {
                        _root.createEmptyMovieClip("mask_mc",_root.getNextHighestDepth());
                        mask_mc._x = _root.gallery_x;
                        mask_mc._y = _root.gallery_y;
                        mask_mc.beginFill(0x000000,100);
                        mask_mc.lineTo(_root.gallery_width,0);
                        mask_mc.lineTo(_root.gallery_width,_root.gallery_height);
                        mask_mc.lineTo(0,_root.gallery_height);
                        mask_mc.lineTo(0,0);
                        container_mc.setMask(mask_mc);
              function scrolling() {
                        _root.onEnterFrame = function() {
                                  container_mc._y += Math.cos(((mask_mc._ymouse)/mask_mc._height)          *Math.PI)*15;
                                  if (container_mc._y>mask_mc._y) {
                                            container_mc._y = mask_mc._y;
                                  if (container_mc._y<(mask_mc._y-(container_mc._height-mask_mc.          _height))) {
                                            container_mc._y = mask_mc._y-(container_mc._height-          mask_mc._height);

    You should create a manually movieclip symbol with nothing in it and take a copy of it from the library and place it in the frame where you intend for the gallery to display.  Give it an instance name of "container_mc" and remove the following line from your callThumbs function
    _root.createEmptyMovieClip("container_mc",_root.getNextHigh estDepth());
    You probably need to do the same for the mask and the full images since they appear to also be created using dynamic mc's.

  • How do I tile two windows in a mac (10.7.5)?

    In windows I could have tiled two windows (or more) horizontally or vertically, while I decide on the ration between the two windows opened.
    how do I do so in a mac?

    Manually.
    OS X then remembers the size and position of windows once you save and re-open them.

  • How can i install C:\WINDOWS\system32\regsvr32 Msx...

    how can I install C:\WINDOWS\system32\regsvr32 Msxml3.dll for Nokia N70 on windows XP?

    Run command:
    regsvr32 msxml3.dll
    Msxml3.dll is a Microsoft XML parser dynamic link library. It is
    obviously needed by PC Suite, but wasn't registered as installed
    by the system. Using the "regsvr32" command on the .dll registers the file.
    What's the law of the jungle?

  • How to reset the default window size

    Hi!
    I played around with the different layouts of Adobe Connect Pro and somehow got a real chaos of window sizes and window positions when changing the resolution as well. How can I reset the layout to the default layout settings (window size, window position, which window should appear)? At this moment I cannot move a windows because it's too big to move or resize it.
    Is there a possibility to undo these changes?
    Thank you!
    Best regards,
    Thomas

    Does anyone know how to reset the meeting layout during a running meeting?

  • How do I position a apDiv tag?

    Hi there,
    I am having trouble trying to position my apDiv tag (apDiv1).
    How do i position it so that when the browser window is resized, it stays directly under the words "quick links"
    Please see my page https://dl.dropbox.com/u/4966582/intranet/index.html
    Also, does anyone know why two faint lines are appearing in the bottom half of the page?
    Thanks
    Nathan

    First, there's no reason at all for apdivs in your layout.  Do away with it altogether.
    The lines are appearing because your footer is one big image and it's not a repeating image and either it doesn't go to the edge or it doesn't match up with your.  Again this has to do with your layout.  There is really no reason to make everything into big images like you have.  Make a simple 450px high by 5px wide image and use it for your footer bg.  Set it to repeat-x.
    My suggestion would be to just start with a template or look to a framework like Bootstrap to help you out with the coding and look at making the site with CSS.
    http://twitter.github.com/bootstrap/index.html

Maybe you are looking for

  • How do I connect my canon ip3400

    I had to unplug my computer, printer, modem and router. I put it back together but now I can't print. I see the printer in the 'print dialog' showing the printed job, trying to connect, saying printer is not connected. What did I forgot to connect? I

  • Audigy 2 ZS - Break out Box/Rem

    I was wondering about this, is there any other application that can take advantage of the breakout-box and remote other then what Creative supplies? I find that most of the Creative applications tend to be too. memory heavy, so I was wondering does a

  • Start up time air vs pro

    Looking to buy mac air or mac pro notebook for my wife.  Does the Air have a significantly shorter start-up time from "power off" mode vs the Pro or are they similar? 

  • Edit History in Bridge

    I have been looking for a way to link renamed images in files to the original document, which is in a folder with a date and the image itself has the Nikon number (DSCxxxx). When I decide an image is ready to print, I copy it to a print folder on a d

  • Open forms designer in Xwindows mode

    I have reflectionx installed on my client system and need to open forms designer through xwindows? I am not able to get f4desm to work at the reflextionx login prompt. Is there a path that needs to be set on the server? Please let me know. Thanks in