Shiny Language Reference

Language Reference > User Interface


getcontrolypos

int getcontrolypos(int ID);

 

 

Returns the Y position of a control

The GETCONTROLYPOS statement returns the Y position of the top left corner of the control in pixels relative to the top left corner of the display panel. (0, 0) is the top left corner of the display panel.

 

Parameters

ID

The ID of the control to return the position of

 

Return Value

The position in pixels, or -999999 if an invalid control ID was provided (rather than -1, because controls can be positioned outside of the panel boundaries.

 

Example Code

function Init()
{
    // Create a 50*20 button
    int ExplorerButtonID = createbutton(1, 10, 10, 50, 20);
    
    // YPos will be set to 10
    int YPos = getcontrolypos(ExplorerButtonID);
}