cyprus106
Programmer
- Apr 30, 2001
- 654
I have a program where you click on an item in a listview and it dynamically creates a form for the item, with the name of the item. Then it stores the name of that item in a TStringList. (I had a TList, but it wasnt working so I tried a String List, Although I seem to have no luck with either...) Leter I need to access a particular form in the list, so I try to call the form back with this:
(in the OnCreate)
TStringList * MyWindows;
MyWindows = new TStringList;
(when the forms' dynamically created)
MyWindows->Add(NewForm->Name);
(when i need to specifically address the created form)
String to = "myspecialform" /* whatever the form name is */
/* I tried both of these methods without any luck... */
TNewForm* F = (TNewForm*)Form1->MyWindows->[Form1->MyWindows->IndexOf(to)];
TNewForm* F = dynamic_cast<TNewForm*>(Form1->MyWindows->[Form1->MyWindows->IndexOf(to)]);
now all I need to do is access the form that was dynamically created. Maybe I'm going about this all wrong. I have no idea, but It's got me. If anybody can help it would be greatly appreciated Cyprus
(in the OnCreate)
TStringList * MyWindows;
MyWindows = new TStringList;
(when the forms' dynamically created)
MyWindows->Add(NewForm->Name);
(when i need to specifically address the created form)
String to = "myspecialform" /* whatever the form name is */
/* I tried both of these methods without any luck... */
TNewForm* F = (TNewForm*)Form1->MyWindows->[Form1->MyWindows->IndexOf(to)];
TNewForm* F = dynamic_cast<TNewForm*>(Form1->MyWindows->[Form1->MyWindows->IndexOf(to)]);
now all I need to do is access the form that was dynamically created. Maybe I'm going about this all wrong. I have no idea, but It's got me. If anybody can help it would be greatly appreciated Cyprus