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. Showing a Form quickly

Showing a Form quickly

Scheduled Pinned Locked Moved C#
graphicstutorialquestion
4 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
    ranzask
    wrote on last edited by
    #1

    Hi all, I have a form which is "heavy" , it have some pics and rich texts and stuff. when i run the code "this.Show()" to display it starts drawing the form and the user can see the parts of the form being built. i try to created it long time before showing it it still dont work. the form is Borderless and it have a big picture on him with transperent color. any ideas how to show it quick? Ran. R.Z

    D 1 Reply Last reply
    0
    • R ranzask

      Hi all, I have a form which is "heavy" , it have some pics and rich texts and stuff. when i run the code "this.Show()" to display it starts drawing the form and the user can see the parts of the form being built. i try to created it long time before showing it it still dont work. the form is Borderless and it have a big picture on him with transperent color. any ideas how to show it quick? Ran. R.Z

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      There's usually no way to speed things up. Most people who have "heavy" forms are using 100's++ of controls and don't realize that creating a control is an expensive operation. Drawing all of them is also not cheap. The form is not compiled into an .EXE prebuilt with all the controls in place, ready to go. They are created added to the form's Controls collection when the instance of the form is created (calling the its constructor) and the constructor calls the form's InitializeComponents method. I think the next most common problem is using images that are FAR bigger than they need to be for displaying at a normal resolution. For example, loading a 2,000x2,000 pixel image at 32bbp into a PictureBox that is only sized to 200x200. That's 10 times the image detail being put in a box that will never show it. Reduce the image size, if at all possible, to what is actually going to be shown. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      R 1 Reply Last reply
      0
      • D Dave Kreskowiak

        There's usually no way to speed things up. Most people who have "heavy" forms are using 100's++ of controls and don't realize that creating a control is an expensive operation. Drawing all of them is also not cheap. The form is not compiled into an .EXE prebuilt with all the controls in place, ready to go. They are created added to the form's Controls collection when the instance of the form is created (calling the its constructor) and the constructor calls the form's InitializeComponents method. I think the next most common problem is using images that are FAR bigger than they need to be for displaying at a normal resolution. For example, loading a 2,000x2,000 pixel image at 32bbp into a PictureBox that is only sized to 200x200. That's 10 times the image detail being put in a box that will never show it. Reduce the image size, if at all possible, to what is actually going to be shown. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        R Offline
        R Offline
        ranzask
        wrote on last edited by
        #3

        hi well that aint the case. i do not have over resolution at all. i am using 3 smallpics and 1 piger one and another picture which is all over the form. but the resolution is normal and i create it long time before showing it. isnt there some way to tell him to praper the form as picture or something and show it all together..? Ran. R.Z

        D 1 Reply Last reply
        0
        • R ranzask

          hi well that aint the case. i do not have over resolution at all. i am using 3 smallpics and 1 piger one and another picture which is all over the form. but the resolution is normal and i create it long time before showing it. isnt there some way to tell him to praper the form as picture or something and show it all together..? Ran. R.Z

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Nope. You'd be going through the same problem just to get a snapshot of the form. You'd also have to wait until the thing draw the REAL form to get usable controls. If you're only using a few controls and pics, then what's taking so long? Perhaps a code profile would be in order. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          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