Shiny Language Reference

Language Reference > User Interface > Edit Boxes


geteditboxcaretpos

int seteditboxcaretpos(int ID);

 

Gets the position of the caret in the edit box

The GETEDITBOXCARETPOS statement returns the position of the caret in an edit box.

 

Parameters

ID

The control ID of the control you wish to change the style of

 

Return Value

The zero-based position of the caret in the edit box.

 

Example Code

// Create a 50x20 editbox at 10, 10 and store it's ID
int Id = createeditbox(1, 10, 10, 50, 20);


// Set the editbox text to "Hello World"
setcaption(Id, "Hello World");

// Set the edit box caret to be at the end of "Hello"
seteditboxcaretpos(Id, 5);


// Retrieve the caret position (5)
int CaretPos = geteditboxcaretpos(Id);