Lightweight controls?
-
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
-
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
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 -
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 GandhiThe 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 ...
-
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 ...
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 -
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