473,399 Members | 4,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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, LockWindowUpdate 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

Jul 17 '05 #1
1 4733
"Calan" <no**@nospam.com> wrote in
news:ip**************@fe25.usenetserver.com:
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,
LockWindowUpdate 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


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 **
----------------------------------------------------------
http://www.usenet.com
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Job Lot | last post by:
I have an Expense Data Entry form which contains a DataGrid showing various expense categories. There are three columns Description, Cash Exp, Credit Exp, where Description column is readonly. ...
1
by: Rhy Mednick | last post by:
I'm creating a custom control (inherited from UserControl) that is displayed by other controls on the form. I would like for the control to disappear when the user clicks outside my control the...
8
by: Ryan Chavez | last post by:
Hello, I'm working on a project that basically draws lines onto a PictureBox control. Now I'm using a Timer with an interval of 100 to draw the information. Now my code looks something like this:...
1
by: Martin Horn | last post by:
Hi all, I'm trying to save a picturebox image to a database. This is part of the code I'm using:- <snip> Private drv As DataRowView Private dr As MainDataSet.OrdersRow If...
1
by: Filippo Bettinaglio | last post by:
Hi, I have a PictureBox with the border set to BorderStyle = FixedSingle and it comes up with a nice Black border. How can I change it at runtime? I use VS2005 (net2 framework)
3
by: senfo | last post by:
I developed a Windows control in VS 2005 that inherits from the PictureBox Control that adds the ability to select images in a Windows application. It is, however, experiencing a strange issue...
7
by: MasterMax1313 | last post by:
I'm trying to make a grid of picture box controls, which I do via code. Each of these boxes has a mouseclick, mousedown, mouseup, and mouseenter event. The mouseclick event is simple enough and works...
7
by: active | last post by:
In control panel/Display/Appearance/Effects if : 'Use the following method to smooth edges of screen fonts' is checked and ClearType is selected in the combobox (no problem if Standard is...
0
by: jhop | last post by:
Hello everyone, I am having a slight problem with a program i am working on for a class, I am using Visual Studio 2005. The program only allows the up arrow key as input. In the code it is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.