Shiny Language Reference

Language Reference > User Interface


getcontrolwidth

int getcontrolwidth(int ID);

 

 

Returns the width of a control

The GETCONTROLWIDTH statement returns the width of a control in pixels. This statement applies to the most logical form of a control. For example, when applied to a button it simply returns the width, however when applied to a combobox it returns the width of the non-dropdown state.

 

Parameters

ID

The ID of the control to resize

 

Return Value

The width in pixels, or -1 if an invalid control ID was provided

 

Example Code

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