Hi all,
I recently started a new job and have been thrown in the deep with a project. It was all well and good until it was decided that I would develop the windows software on top of everything else. Long story short, I know a little bit about C++.net but not heaps.
I want to be able to address an object using a variable so I can manipulate many text boxes with a for loop.
For example:
System::String^ AString;
int i = 1;
AString = "textBox" + i; // This bit works fine...
Now AString contains the name of the object I want to manipulate but I don't know how to call it...
this->?AString?->Text = "Hello";
What do I put in place of ?AString? or what do I use to achieve the same goal with different code?
I'll give them a go but I'm using CLR not MFC. Sorry I didn't indicate this earlier but I didn't realise that MFC supports the .net library. If you know how it's definitely done in CLR it would help. I should probably have said I'm using Visual Studio 2005 as well.
I tried the code this morning and it worked and absolute treat. To me that seemed like a lot of code, but that's because I spend most of my time programming microcontrollers and such where efficiency is essential. But windows software design will have none of that.
Thanks a bunch for everyone's help, it made my day today.