Working When Window From Is Already Shown [modified]
-
Hi! I want to create file updater but i want to see the progress in the form (by text labels). in which Event should i start the application so the Form will be loaded and visible on the screen? (I have tried Form_Load,Form_Shown,Form_Activated and they all run the application before the form is visible) maybe the application is fast then how can i wait for the Form to Load and then run the application, should i use theards?How? I am trying to run this from the Main of the Form but i can not run this because i get that my main function needs to be with an Object Reference. how can i run it? Thanks :) -- modified at 5:57 Saturday 15th September, 2007
-
Hi! I want to create file updater but i want to see the progress in the form (by text labels). in which Event should i start the application so the Form will be loaded and visible on the screen? (I have tried Form_Load,Form_Shown,Form_Activated and they all run the application before the form is visible) maybe the application is fast then how can i wait for the Form to Load and then run the application, should i use theards?How? I am trying to run this from the Main of the Form but i can not run this because i get that my main function needs to be with an Object Reference. how can i run it? Thanks :) -- modified at 5:57 Saturday 15th September, 2007
According to MSDN Shown event occurs whenever the form is first displayed so it should meet your needs.
#region signature my articles #endregion
-
According to MSDN Shown event occurs whenever the form is first displayed so it should meet your needs.
#region signature my articles #endregion
-
I saw it too, but it does not, i have an image on the form and so i see only the frame and not the form it self :(
Can you post the code snippet?
#region signature my articles #endregion
-
Can you post the code snippet?
#region signature my articles #endregion
This is the main function: public void Form1_Main() { if (copyBool) { //Find if Application is running copyBool = false; // int window = FindWindow("Virtual DJ", true); // if(window == 0) // this.Close(); int window = 1; if (window != 0) { string FolderPath = null; TreeNode tr = null; Diractory_Path dp = new Diractory_Path(); dp.GetFolderMusicPath(); FolderPath = dp.GetPathString(); if (FolderPath == "") { MessageBox.Show("The Path is empty, the program ended!!!"); this.Close(); } label1.Text = "The Files are being transfared!!!"; ///This is The copy files function!!! CopyFolderData(FolderPath, ref tr); ///This is the Uodate XML section. label1.Text = "The XML are being Updated!!!"; XML_Handle xml_h = new XML_Handle(); xml_h.XMLHandleMain(); if (xml_h.GetXMLFile() == " ") this.Close(); xml_h.HandleXMLData(); ///This is the Playlists creation. label1.Text = "The PlayLists are being created!!!"; PlayList playList = new PlayList(); playList.PlayListHandleMain(tr); label1.Text = "Test Was Finished!!!"; System.Threading.Thread.Sleep(2000); this.Close(); } } } This is the call: static void Main() { Application.Run(new Form1()); this.Form1_Main(); ///The installation project starts here!!! }