Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Working When Window From Is Already Shown [modified]

Working When Window From Is Already Shown [modified]

Scheduled Pinned Locked Moved C#
question
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    ytubis
    wrote on last edited by
    #1

    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

    G 1 Reply Last reply
    0
    • Y ytubis

      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

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      According to MSDN Shown event occurs whenever the form is first displayed so it should meet your needs.

      #region signature my articles #endregion

      Y 1 Reply Last reply
      0
      • G Giorgi Dalakishvili

        According to MSDN Shown event occurs whenever the form is first displayed so it should meet your needs.

        #region signature my articles #endregion

        Y Offline
        Y Offline
        ytubis
        wrote on last edited by
        #3

        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 :(

        G 1 Reply Last reply
        0
        • Y ytubis

          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 :(

          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          Can you post the code snippet?

          #region signature my articles #endregion

          Y 1 Reply Last reply
          0
          • G Giorgi Dalakishvili

            Can you post the code snippet?

            #region signature my articles #endregion

            Y Offline
            Y Offline
            ytubis
            wrote on last edited by
            #5

            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!!! }

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups