TextBoxCollection.Item

TextBoxCollection indexer (1 of 2)

Gets the TextBox element at the specified index.

public TextBox this[int index] { get; }
ParameterDescription
indexThe zero based index of the element.

Return Value

The element at the specified index.

Examples


[C#]
int index = textBoxCollection.Count - 1;
TextBox txb = textBoxCollection[index];

See Also


TextBoxCollection indexer (2 of 2)

Gets the TextBox element by the name.

public TextBox this[string name] { get; }
ParameterDescription
nameThe name of the text box.

Examples


[C#]
string txtboxName = "textbox 1"; 
TextBox txb2 = textBoxCollection[txtboxName];
if(txb2 != null)
{
    //do what you want
}

See Also