473,322 Members | 1,703 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,322 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 2175
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.