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. Graphic Problem

Graphic Problem

Scheduled Pinned Locked Moved C#
csharpdatabasecomhelpquestion
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.
  • R Offline
    R Offline
    Reza Shojaee
    wrote on last edited by
    #1

    Hi My Friends, I write a program with C#, that after clicking button OpenFileDialog appear and you can select a text file and then my program read the text file and insert into Database. This program work good and no problem but after click select and open text file in the OpenFileDialog about 2 or 3 second (depend to the size of file) below picture appear : http://www.freewebs.com/autoclinic/images/untitled.gif[^] I want to know how can prevent this action ? Best Regards, Reza Shojaee

    G 1 Reply Last reply
    0
    • R Reza Shojaee

      Hi My Friends, I write a program with C#, that after clicking button OpenFileDialog appear and you can select a text file and then my program read the text file and insert into Database. This program work good and no problem but after click select and open text file in the OpenFileDialog about 2 or 3 second (depend to the size of file) below picture appear : http://www.freewebs.com/autoclinic/images/untitled.gif[^] I want to know how can prevent this action ? Best Regards, Reza Shojaee

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

      Your program's UI freezes because it is busy reading txt file and inserting it into database so it has no time to repaint itself. Try moving the file processing code into a new thread.

      Giorgi Dalakishvili #region signature my articles #endregion

      R 1 Reply Last reply
      0
      • G Giorgi Dalakishvili

        Your program's UI freezes because it is busy reading txt file and inserting it into database so it has no time to repaint itself. Try moving the file processing code into a new thread.

        Giorgi Dalakishvili #region signature my articles #endregion

        R Offline
        R Offline
        Reza Shojaee
        wrote on last edited by
        #3

        Thanks for your guidance, If I don't want use multithread programming.Can repaint form manually before insert data into database? Best Regards, Reza Shojaee

        G 1 Reply Last reply
        0
        • R Reza Shojaee

          Thanks for your guidance, If I don't want use multithread programming.Can repaint form manually before insert data into database? Best Regards, Reza Shojaee

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

          Try Application.DoEvents() method

          Giorgi Dalakishvili #region signature my articles #endregion

          R 1 Reply Last reply
          0
          • G Giorgi Dalakishvili

            Try Application.DoEvents() method

            Giorgi Dalakishvili #region signature my articles #endregion

            R Offline
            R Offline
            Reza Shojaee
            wrote on last edited by
            #5

            Special thanks for you. my problem solved. Best Regards, Reza Shojaee

            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