Problem with changing backcolor of picturebox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Calan

    Problem with changing backcolor of picturebox

    I have a form with some picture boxes as buttons. I'm setting the picture
    property to a gif file for "normal", and to a different gif for the
    "pressed" state. This works fine. I get into trouble with the fact that the
    gif files have a transperent region in the middle (the button icon) that
    lets the back color of the picture box show through. This lets me change the
    button highlight to any user-specified color when I mouseover the picbox
    (which is done very inefficiently I might add, but that's another story).

    Everything works, except that I get occasional flicker that shows through
    the image as the backcolor is changing. Is there a way to change the picture
    box backcolor without any flicker? I've tried setting it to invisible and
    then back, played with z-order, LockWindowUpdat e API, etc., all to no avail.
    Some type of memory painting/swapping maybe?

    Any help is greatly appreciated. Any good advice for an efficient
    "mouseover" event for controls would also be greatly appreciated.

    Thanks much in advance



  • TecCRC

    #2
    Re: Problem with changing backcolor of picturebox

    "Calan" <none@nospam.co m> wrote in
    news:ipfad.169$ Z9.160@fe25.use netserver.com:
    [color=blue]
    > I have a form with some picture boxes as buttons. I'm setting the
    > picture property to a gif file for "normal", and to a different gif
    > for the "pressed" state. This works fine. I get into trouble with the
    > fact that the gif files have a transperent region in the middle (the
    > button icon) that lets the back color of the picture box show through.
    > This lets me change the button highlight to any user-specified color
    > when I mouseover the picbox (which is done very inefficiently I might
    > add, but that's another story).
    >
    > Everything works, except that I get occasional flicker that shows
    > through the image as the backcolor is changing. Is there a way to
    > change the picture box backcolor without any flicker? I've tried
    > setting it to invisible and then back, played with z-order,
    > LockWindowUpdat e API, etc., all to no avail. Some type of memory
    > painting/swapping maybe?
    >
    > Any help is greatly appreciated. Any good advice for an efficient
    > "mouseover" event for controls would also be greatly appreciated.
    >
    > Thanks much in advance
    >
    >
    >[/color]

    have you tried setting the autoredraw setting of the picture box to True?
    this will eliminate flicker

    Posted Via Usenet.com Premium Usenet Newsgroup Services
    ----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
    ----------------------------------------------------------
    Best Usenet Service Providers 2025 ranked by Newsgroup Access Newsservers, Usenet Search, Features & Free Trial. Add VPN for privacy.

    Comment

    Working...