Select nie jest metodą System.String tylko System.Windows.Forms.TextBox i ma kilka przeładowań. Dla Ciebie będzie to Select(Int32 start, Int32 length).
public void SelectMyString()
{
// Create a string to search for the word "fox".
String searchString = "fox";
// Determine the starting location of the word "fox".
int index = textBox1.Text.IndexOf(searchString, 16, 3);
// Determine if the word has been found and select it if it was.
if (index != -1)
{
// Select the string using the index and the length of the string.
textBox1.Select(index, searchString.Length);
}
}
Najbardziej interesuje mnie ten fragment:
textBox1.Select(index, searchString.Length);
Próbuję przerobić go na swoje potrzeby (zrobiłem analogicznie do podanego przykładu):
textBox.Select(1,1);
Kompilator nie wywala błędu, lecz po kliknięciu w kontrolkę nic się nie dzieje;/
Tak. Cała akcja się dzieje w “private void buttonWytnij_Click(object sender, EventArgs e)”. Inne akcje takie jak usuwanie pojedynczych elementów z textBoxa działają. O tym co sie ma stać decyduje radioButton, lecz na 100% to nie on tutaj wini.