473,385 Members | 1,615 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,385 software developers and data experts.

paint handler problem

L.S.,

I am using the picture box's paint event to load an image if not yet loaded.
The picture box is one of many that together occupy the area of a panel. Not
all boxes are visible so not all images have to be preloaded.

Problem is that some images do show while others do not.

My paint handler just loads the image of not yet loaded.

Do I have to call the original paint handler to do the painting? I am not
painting anything from my paint handler but some images do get painted.

A little confused...any one has a clue?

This is in the handler:

PictureBox p = (PictureBox) sender;
if( p.Tag is string )
{
if( p.Image == null )
{
p.SuspendLayout();
p.Image = Image.FromFile( m_imageFile );
p.ResumeLayout();
}
}
T.I.A.
Nov 16 '05 #1
2 2178
Joep wrote:
Do I have to call the original paint handler to do the painting? I am
not painting anything from my paint handler


If you are not painting who is doing the painting !?

You MUST call "base.Paint(sender, e)"
--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp

Do you need daily reports from your server?
http://sourceforge.net/projects/srvreport/
Nov 16 '05 #2
Thanks,

Problem is caused by panel that is limited to a maximum size (i.e. Size
members are ints). The collection of picture boxes exceeds that maximum. So
I will need more than one panel if dimensions exceed maximum of a single
panel.

Calling base is not needed, picture boxes within range ARE painted so the
picture box's paint handler is called as well as my added handler.
Bye

Nov 16 '05 #3

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

Similar topics

2
by: Joep | last post by:
L.S., I am using the picture box's paint event to load an image if not yet loaded. The picture box is one of many that together occupy the area of a panel. Not all boxes are visible so not all...
0
by: Christian Lipps | last post by:
Hello, I've the following problem: There is a form having a picture box on it. The box's paint event is implementet as follow: <within the paint event> Size drawArea = pictureBox1.Size; ...
3
by: pacemkr | last post by:
Is it possible to force a control to paint to a Graphics object (or Device Context, or a bitmap, anywhere aside from the form) that I provide. I am writing a windows form class that supports...
7
by: Schorschi | last post by:
I know there is a way to do this, but I don't know how. Via a custom event? I have some code that I only want to run during a paint event. I could build a form instance that has the code and...
6
by: jcrouse | last post by:
I am rotating some text is some label controls. In the one place I use it it works fine. In the other place I use it I can't figure out the syntax. I don't really understand the event. Where it...
4
by: Kürşat | last post by:
Hi all, I do some drawing in a form's paint event handler and I have a button on that form. Whenever the mouse enters or leaves the button Form's paint event occurs. Isn't that a strange...
2
by: Jim Lewis | last post by:
I have a simple worker thread that does "BeginInvoke(UpdateUI)". In UpdateUI I have "panel.Refresh ()" which the debugger shows is executed. Yet a breakpoint in the panel's Paint handler never gets...
5
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, On a usercontrol I've put a set of radiobuttons within a groupbox. These radiobuttons have visual style enables, i.e. they turn orange when hovering over them and green when pushed. ...
9
by: raylopez99 | last post by:
Just an observation: pens for drawing lines in Win Forms are tricky when assignment is inside the paint handler. inside of the Paint handler, but not inside a "using" brace (that is, outside of...
5
tranc3d
by: tranc3d | last post by:
I want to understand the mechanism behind the painting of a control: what are the functions (handlers) involved and when they are called. I have a custom control based on a Panel. I think the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.