From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I set the position and size of the front panel using the FPRunTimePosRunCustom method in a c# app?

Solved!
Go to solution

how do I set the position and size of the front panel using the FPRunTimePosRunCustom method in a c# app?

 

 

0 Kudos
Message 1 of 3
(2,560 Views)

PIFORSystemTemplateVI.FPRunTimePosRunCustom((Int16)500, (Int16)500);

 

this didn't work which is odd because the LabVIEW help files say that I only need to enter a 16 bit integer number.

 

I've also tried to create 16 bit integer number variables and set them to any value and then use the variables for position and size, but that didn't work either.

Has anyone used this method or has anyone got any ideas as to how to use this method? 

 

FPRunTimePosRunCustom Method

Requires: Base Package

Class: VI Methods (ActiveX)

Sets a custom position for the VI to move its front panel to every time the VI runs.

For single-pane front panels, minimum size refers to the content area of that pane, not including the scroll bars. For multi-pane front panels, minimum size refers to the entire front panel, including any visible scroll bars.

Syntax

object.FPRunTimePosRunCustom([position], [size])

Parameters

NameTypeDescription
position 16-bit integer A cluster of top and left pairs that indicate the front panel window position.
size 16-bit integer A cluster of height and width pairs that indicate the size in pixels of the front panel.

Return Value

none

 

 

 

 

0 Kudos
Message 2 of 3
(2,556 Views)
Solution
Accepted by topic author scurley

I found a solution!Smiley Very Happy -Set the size and position of the front panel using the

File >> VI Properties >> Window Run-Time Position(in catagory list) >> Custom(in position drop down box),

then just either accept the current position and size(leave the check boxes checked) or set the values you want directly (uncheck the check boxes and fill in the numbers), or physically position and size the front panel and the use the "set to current position" button and the "set to current size" button. Whatever is easiest for you.

 

OK so it's not making use of the VI Methods(Active X) FPRunTimePosRunCustom([Position], [Size]) method but if labview want to make it to difficult to use then other ways must be found.

 

 

0 Kudos
Message 3 of 3
(2,529 Views)