Click to See Complete Forum and Search --> : Which uses less system resources - PictureBox or Frame?
mwdelta
Dec 30th, 1999, 07:36 AM
The application I am developing uses lots of masking elements, like to hide part of a textbox. Both frames and pictureboxes work, but I'm wondering which uses less memory and resources. Thanks!
------------------
Mike Wellems
PowerQuery
Clunietp
Dec 30th, 1999, 10:33 PM
I found this in MSDN:
Use Image Controls Instead of Picture Box Controls
This optimization improves the speed and minimizes the size of your application; use it whenever possible. When you are simply displaying pictures and reacting to click events and mouse actions on them, use the image control instead of the picture box. Don’t use a picture box unless you need the capabilities only the picture box provides, such as graphics methods, the ability to contain other controls, or dynamic data exchange (DDE).
Comparing a picture control with a frame is kind of like comparing apples to oranges (in terms of functionality), but from the above statement, I would deduct that the frame control uses less memory because it does not provide the features that the picture box does. Features = memory
Tom
Frans C
Dec 30th, 1999, 10:45 PM
I would also say that a Frame doesn't use as much memory as a PictureBox, but don't Frame me on that.
yeah, but oranges make you pull funny faces if you eat them too fast, apples are safe!
The MSDN snippet is right, but the picture box has better "special effects"!
mwdelta
Dec 31st, 1999, 12:59 AM
Thanks for your help. I know that about the Image being less resource-intensive than a Picturebox, but for my purposes, an Image won't work. What I need it for is to mask over part of a textbox. Try to get an image control to be "on top" of a textbox. It doesn't work, unless it's in a PictureBox or Frame. I suspect these both work because they're containers. I suspect that a frame uses less resources too, but if anyone knows any controls that can be placed over a textbox and use little memory, let me know.
------------------
Mike Wellems
PowerQuery
Juan Carlos Rey
Jan 2nd, 2000, 09:24 AM
Frames are OK and safe as respect to resources usage, as long as you limit their number to say less than a thousand...
No, seriously, I don't think that a few frames can compromise your system.
Joacim Andersson
Jan 2nd, 2000, 03:14 PM
A TextBox can be put on an other TextBox. A TextBox doesn't use that much resorces (if it's not filled with 32KB of text). If you set the Enabled property to False no caret will be visible either.
Good luck!
------------------
Joacim Andersson
joacim@programmer.net
joacim@yellowblazer.com
www.YellowBlazer.com (http://www.YellowBlazer.com)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.