adding components ....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • temp2@cfl.rr.com

    adding components ....

    Hello,

    I'm wanting to add 320,000 controls(Panels ) to an instantiated Panel
    object. Yes, you heard me right, 320,000. It's for displaying a
    320,000 int buffer memory status. Long story. Anyway, the controls
    Add() method is way to slow for this. AddRange() isn't any better.
    Probably adding that many little Panels to the controls array for the
    main Panel is problematic. Anybody got any better ideas?

    TIA
  • Peter Duniho

    #2
    Re: adding components ....

    On Sat, 18 Oct 2008 15:36:06 -0700, <temp2@cfl.rr.c omwrote:
    I'm wanting to add 320,000 controls(Panels ) to an instantiated Panel
    object. Yes, you heard me right, 320,000. It's for displaying a
    320,000 int buffer memory status. Long story. Anyway, the controls
    Add() method is way to slow for this. AddRange() isn't any better.
    Probably adding that many little Panels to the controls array for the
    main Panel is problematic. Anybody got any better ideas?
    Yes. Don't do that.

    One Control instance per buffer element is a wholely inappropriate use of
    the Control class.

    If you can arrange things so that you only ever are displaying some very
    small number of buffer elements at a time (a few dozen at most is probably
    reasonable), then you can essentially virtualize the display, updating the
    visible controls as appropriate for whatever buffer elements you want to
    present to the user at any given moment.

    If that's not feasible, then you should write a custom control that
    displays the buffer element status directly in a single control.

    Hundreds of thousands of controls are a bad idea, even when spread across
    multiple windows. Hundreds of thousands of controls in a single window is
    just ridiculous.

    Pete

    Comment

    • raylopez99

      #3
      Re: adding components ....

      Yeah I second that motion. It's ridiculous. I don't even know if an
      average size screen has 320000 pixels on it... But if it does, you can
      turn on and off every pixel, using a library function that I'm sure is
      available...

      RL

      Peter Duniho wrote:
      Hundreds of thousands of controls are a bad idea, even when spread across
      multiple windows. Hundreds of thousands of controls in a single window is
      just ridiculous.
      >

      Comment

      • Rudy Velthuis

        #4
        Re: adding components ....

        raylopez99 wrote:
        Yeah I second that motion. It's ridiculous. I don't even know if an
        average size screen has 320000 pixels on it
        1024x768 (that is rather small these days) would have, well, approx.
        768,000 pixels already. <g>

        But 320,000+ panels would bring the system down, no doubt. I doubt
        Windows can handle so many windows. <g>
        --
        Rudy Velthuis http://rvelthuis.de

        "Sometimes I lie awake at night, and I ask, 'Where have I gone
        wrong?' Then a voice says to me, 'This is going to take more
        than one night.'" -- Charlie Brown.

        Comment

        Working...