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. windows forms refresh, update???

windows forms refresh, update???

Scheduled Pinned Locked Moved C#
helpwinformstutorialquestionannouncement
6 Posts 3 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.
  • D Offline
    D Offline
    dimo1982
    wrote on last edited by
    #1

    Hi To all I`m very new to the programming and got stuck. So i`ve been trying to write a program using Windows Form which include several different panels on. User can choose between which one is visible. on each form there are few pictureboxes and my problem is ..... when you swich between them in the runtime it`s not smooth enough :( user can see loadning frames of these picture boxes for few miliseconds this is really annoying. Is there any easy way of loading it in the background and show it after its ready or something ??? I started reading about threads etc but at the moment its quite difficult, i will be gratefull if someone could explain it with an example Thanks in advance Dims

    0 L 2 Replies Last reply
    0
    • D dimo1982

      Hi To all I`m very new to the programming and got stuck. So i`ve been trying to write a program using Windows Form which include several different panels on. User can choose between which one is visible. on each form there are few pictureboxes and my problem is ..... when you swich between them in the runtime it`s not smooth enough :( user can see loadning frames of these picture boxes for few miliseconds this is really annoying. Is there any easy way of loading it in the background and show it after its ready or something ??? I started reading about threads etc but at the moment its quite difficult, i will be gratefull if someone could explain it with an example Thanks in advance Dims

      0 Offline
      0 Offline
      0x3c0
      wrote on last edited by
      #2

      You could call pictureBox1.SuspendLayout();, load your image into the PictureBox, then call pictureBox1.ResumeLayout(true); to update the layout.

      Between the idea And the reality Between the motion And the act Falls the Shadow

      D 2 Replies Last reply
      0
      • 0 0x3c0

        You could call pictureBox1.SuspendLayout();, load your image into the PictureBox, then call pictureBox1.ResumeLayout(true); to update the layout.

        Between the idea And the reality Between the motion And the act Falls the Shadow

        D Offline
        D Offline
        dimo1982
        wrote on last edited by
        #3

        right i`ll try that but i forgot to tell you that on the form is background 800x600 bitmap so maybe that is the reason that is so slow.

        0 1 Reply Last reply
        0
        • D dimo1982

          right i`ll try that but i forgot to tell you that on the form is background 800x600 bitmap so maybe that is the reason that is so slow.

          0 Offline
          0 Offline
          0x3c0
          wrote on last edited by
          #4

          It doesn't really matter, except that you might want to call SuspendLayout and ResumeLayout for the form as well. That might speed things up slightly, but I've not tested it.

          Between the idea And the reality Between the motion And the act Falls the Shadow

          1 Reply Last reply
          0
          • 0 0x3c0

            You could call pictureBox1.SuspendLayout();, load your image into the PictureBox, then call pictureBox1.ResumeLayout(true); to update the layout.

            Between the idea And the reality Between the motion And the act Falls the Shadow

            D Offline
            D Offline
            dimo1982
            wrote on last edited by
            #5

            It`s not working for me, what i`ve noticed is that all the panel as the user switches between do same thing whether there are only labels or pictureBoxes so i`m assuming that there`s the problem with bitmap on the background of the form. panels they are all set up as transparent. any ideas??

            1 Reply Last reply
            0
            • D dimo1982

              Hi To all I`m very new to the programming and got stuck. So i`ve been trying to write a program using Windows Form which include several different panels on. User can choose between which one is visible. on each form there are few pictureboxes and my problem is ..... when you swich between them in the runtime it`s not smooth enough :( user can see loadning frames of these picture boxes for few miliseconds this is really annoying. Is there any easy way of loading it in the background and show it after its ready or something ??? I started reading about threads etc but at the moment its quite difficult, i will be gratefull if someone could explain it with an example Thanks in advance Dims

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              Hi, if your app is slow, try and figure out why and fix it. Are your images way too large and getting downscaled all the time? are you using some fancy transparancy stuff? And did you look into double-buffering? you might try and set DoubleBuffered true. That does not really solve performance problems, it does hide some of its visual effects though. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


              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