Hi, I'm trying to loop through multiple textboxes in a C++ form using visual studio.net 2008 to set the selection start for each. The code for a single textbox is easy:
textBox1->SelectionStart = 4;
When I try to assign textBox1 to a Control variable, and assign selection start, I get an error:
Control^ myControl;
myControl = textBox1;
myControl->SelectionStart = 4;
The error says:
error c2039: 'SelectionStart' : is not a member of 'System::Windows::Forms::Control'
I have no trouble assigning text this way:
Control^ myControl;
myControl = textBox1;
myControl->Text = "hello";
Does anyone know how I can do this?