I have 2 Forms in my Windows Form application. Form1 creates .txtfiles.
I open Form2 from Form1 and can see the .textfiles that is created in a comboBox3.
If I open the application from the beginning and go to Form2 I will see all .txt files that exists in a folder in this comoBox3. While the application is open I close Form2 and is then on Form1 where I now will create a new .text file.
I open Form2 and see if this is in the comboBox3 and it isn´t ?
If I close the whole application, open it again and go to Form2 then it will appear in the comboBox3.
Why do I have to close the application and open it again to receive the changes.
I load in the .txt files to the comboBox3 with this code under Form2(void):
Form2(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
System::String ^ Files10 = "C:\\Globejennife\\Groupjennif\\";
array<System::String ^> ^ files4 = System::IO::Directory::GetFiles(Files10,"*.txt");
array<Char>^ chars = {'.'};
array<System::String ^> ^ splits;
for (int count1 = 0; count1 < files4->Length; count1++)
{
splits = files4[count1]->Split(chars);
comboBox3->Items->Add(splits[0]->ToString()->Substring(29));
}
}