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. Slow rendering when adding usercontrol to panel

Slow rendering when adding usercontrol to panel

Scheduled Pinned Locked Moved C#
question
7 Posts 4 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.
  • F Offline
    F Offline
    Fayu
    wrote on last edited by
    #1

    I have a usercontrol with many controls (labels, textboxes, etc...). When I try to add this usercontrol to a panel, the rendering of the usercontrol is slow. You can see controls rendering when the control is added to the panel. I have tried to the SuspendLayout/ResumeLayout of the usercontrol, panel as well as the form itself, but you can still see the rendering. How do I stop this from happening? Thanks in advance.

    B S 2 Replies Last reply
    0
    • F Fayu

      I have a usercontrol with many controls (labels, textboxes, etc...). When I try to add this usercontrol to a panel, the rendering of the usercontrol is slow. You can see controls rendering when the control is added to the panel. I have tried to the SuspendLayout/ResumeLayout of the usercontrol, panel as well as the form itself, but you can still see the rendering. How do I stop this from happening? Thanks in advance.

      B Offline
      B Offline
      Blubbo
      wrote on last edited by
      #2

      I've had the same problem too and am really stumped. I have 256 textboxes on a GUI. man! is that really slow to populate the textboxes. (I'm working on the table - somewhat like multiplication table).

      D 1 Reply Last reply
      0
      • F Fayu

        I have a usercontrol with many controls (labels, textboxes, etc...). When I try to add this usercontrol to a panel, the rendering of the usercontrol is slow. You can see controls rendering when the control is added to the panel. I have tried to the SuspendLayout/ResumeLayout of the usercontrol, panel as well as the form itself, but you can still see the rendering. How do I stop this from happening? Thanks in advance.

        S Offline
        S Offline
        Super Lloyd
        wrote on last edited by
        #3

        idea of possible hack. make it Visible = false add it then Visible = true dunno if it will work, but it might be worth a shot... Also, if you UserControl and its child are translucent / transparent that might be suboptimal, the WinForm implementatino is quite labor intensive. I think there is a flag somewhere which turn translucency off. But I forgot, haven't done WinForm in a while...

        A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

        F 1 Reply Last reply
        0
        • S Super Lloyd

          idea of possible hack. make it Visible = false add it then Visible = true dunno if it will work, but it might be worth a shot... Also, if you UserControl and its child are translucent / transparent that might be suboptimal, the WinForm implementatino is quite labor intensive. I think there is a flag somewhere which turn translucency off. But I forgot, haven't done WinForm in a while...

          A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

          F Offline
          F Offline
          Fayu
          wrote on last edited by
          #4

          I tried the Visibile workaround... did not work. No controls have transparency as their backcolor. Any other suggestions?

          1 Reply Last reply
          0
          • B Blubbo

            I've had the same problem too and am really stumped. I have 256 textboxes on a GUI. man! is that really slow to populate the textboxes. (I'm working on the table - somewhat like multiplication table).

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

            Blubbo wrote:

            I have 256 textboxes on a GUI

            :omg: I hope I never have to use your application! There is no justifiable reson to require that much data, or to present that much data to/from a user in one view IMO.

            Dave
            BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
            Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
            Why are you using VB6? Do you hate yourself? (Christian Graus)

            B 1 Reply Last reply
            0
            • D DaveyM69

              Blubbo wrote:

              I have 256 textboxes on a GUI

              :omg: I hope I never have to use your application! There is no justifiable reson to require that much data, or to present that much data to/from a user in one view IMO.

              Dave
              BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
              Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
              Why are you using VB6? Do you hate yourself? (Christian Graus)

              B Offline
              B Offline
              Blubbo
              wrote on last edited by
              #6

              LOL... if textboxes are too much, then what's the best way to display the data?

              D 1 Reply Last reply
              0
              • B Blubbo

                LOL... if textboxes are too much, then what's the best way to display the data?

                D Offline
                D Offline
                DaveyM69
                wrote on last edited by
                #7

                I would create a control and draw the data in the OnPaint. If the data needs to be editable, handle the mouse events and display a textbox at the mouse coordinates on right click or whatever, invalidate and get rid of textbox when edit is completed. This will be very quick (many times quicker than creating loads of text boxes) and you have total control over the way everything is drawn. It is possible to databind as well if you wish.

                Dave
                BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
                Why are you using VB6? Do you hate yourself? (Christian Graus)

                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