Results 1 to 7 of 7

Thread: Which uses less system resources - PictureBox or Frame?

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Kansas, USA
    Posts
    58

    Post

    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

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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

  3. #3
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Post

    I would also say that a Frame doesn't use as much memory as a PictureBox, but don't Frame me on that.

  4. #4
    Guest

    Post

    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"!

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Kansas, USA
    Posts
    58

    Post

    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

  6. #6
    Hyperactive Member Juan Carlos Rey's Avatar
    Join Date
    Aug 1999
    Location
    Mendoza, Argentina
    Posts
    301

    Post

    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.

  7. #7
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Post

    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
    [email protected]
    [email protected]
    www.YellowBlazer.com



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width