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. Visual Basic
  4. Lightweight controls?

Lightweight controls?

Scheduled Pinned Locked Moved Visual Basic
data-structureshelpquestion
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.
  • N Offline
    N Offline
    newalfi
    wrote on last edited by
    #1

    Hi, I'm having trouble placing multiple controls onto a VB6 form dynamically. I have created a control array of picture boxes but seem to be restricted to about 200 instances on the form. I need perhaps 260 to 300 (12 columns of 25). This is for a college project. I am using picture boxes because I can 'print' to them (undocumented) in different fonts and sizes - similar to a rich text control - and change the background colour. Any suggestions. Perhaps creating a lightweight control in visual C may be the answer but I wouldn't know where to start.:confused: Any help would be more than welcome, Alan ... Keep the Pound - reject the Euro

    J 1 Reply Last reply
    0
    • N newalfi

      Hi, I'm having trouble placing multiple controls onto a VB6 form dynamically. I have created a control array of picture boxes but seem to be restricted to about 200 instances on the form. I need perhaps 260 to 300 (12 columns of 25). This is for a college project. I am using picture boxes because I can 'print' to them (undocumented) in different fonts and sizes - similar to a rich text control - and change the background colour. Any suggestions. Perhaps creating a lightweight control in visual C may be the answer but I wouldn't know where to start.:confused: Any help would be more than welcome, Alan ... Keep the Pound - reject the Euro

      J Offline
      J Offline
      J Dunlap
      wrote on last edited by
      #2

      newalfi wrote: I have created a control array of picture boxes but seem to be restricted to about 200 instances on the form. I need perhaps 260 to 300 (12 columns of 25). This is for a college project. I am using picture boxes because I can 'print' to them (undocumented) in different fonts and sizes - similar to a rich text control - and change the background colour. Don't even think of it! Every picturebox you make uses a window, brush, pen, etc (and if you use AutoRedraw, a DC). If you need that many, it's long past time to make a custom control. You can even write it in VB6. PS: What do you need it for -what's it's purpose? Maybe I can give you some guidance as to how to go about it.

      "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
      "You must be the change you wish to see in the world." - Mahatma Gandhi

      N 1 Reply Last reply
      0
      • J J Dunlap

        newalfi wrote: I have created a control array of picture boxes but seem to be restricted to about 200 instances on the form. I need perhaps 260 to 300 (12 columns of 25). This is for a college project. I am using picture boxes because I can 'print' to them (undocumented) in different fonts and sizes - similar to a rich text control - and change the background colour. Don't even think of it! Every picturebox you make uses a window, brush, pen, etc (and if you use AutoRedraw, a DC). If you need that many, it's long past time to make a custom control. You can even write it in VB6. PS: What do you need it for -what's it's purpose? Maybe I can give you some guidance as to how to go about it.

        "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
        "You must be the change you wish to see in the world." - Mahatma Gandhi

        N Offline
        N Offline
        newalfi
        wrote on last edited by
        #3

        The student is trying to simulate an Air Traffic Control workstation and needs to be able to maintain 'Cards' showing various aspects of incoming and overflying aircraft. So far, he is showing about 200 cards on the screen each containing (I think) flight number, altitude, heading, and another text line of about 15 characters whose data I am not sure about. As the beginners VB lecturer, I have been asked to help but I havbe never created a custom control in any language. Again, any help or guidance would be greaty appreciated. Alan ...

        J 1 Reply Last reply
        0
        • N newalfi

          The student is trying to simulate an Air Traffic Control workstation and needs to be able to maintain 'Cards' showing various aspects of incoming and overflying aircraft. So far, he is showing about 200 cards on the screen each containing (I think) flight number, altitude, heading, and another text line of about 15 characters whose data I am not sure about. As the beginners VB lecturer, I have been asked to help but I havbe never created a custom control in any language. Again, any help or guidance would be greaty appreciated. Alan ...

          J Offline
          J Offline
          J Dunlap
          wrote on last edited by
          #4

          Perhaps you could do this: Make a class that represents a flight card. Make an array of objects of that type in your form class. Each time you re-draw the form, draw each flight card object in the array directly onto your form (or a single picture box on your form). You might want to set AutoRedraw to True, so that you don't have to re-draw all 200 cards every time the form re-paints. This way, you'll just have to re-draw every time the cards change. HTH

          "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
          "You must be the change you wish to see in the world." - Mahatma Gandhi

          N 1 Reply Last reply
          0
          • J J Dunlap

            Perhaps you could do this: Make a class that represents a flight card. Make an array of objects of that type in your form class. Each time you re-draw the form, draw each flight card object in the array directly onto your form (or a single picture box on your form). You might want to set AutoRedraw to True, so that you don't have to re-draw all 200 cards every time the form re-paints. This way, you'll just have to re-draw every time the cards change. HTH

            "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
            "You must be the change you wish to see in the world." - Mahatma Gandhi

            N Offline
            N Offline
            newalfi
            wrote on last edited by
            #5

            Thanks for that. I'll experiment at home before suggesting to the student but it sounds as though this might work. I'm not aware of an upper limit for class objects. Thanks again, Alan ...

            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