473,396 Members | 2,003 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,396 software developers and data experts.

PaintBox Paint event

hello
I have:
public void MyFunction(PictureBox b, PaintEventArgs e)

how can i set from code this function as PaintBox Paint Event handler ?
I tried:
box.Paint=MyFunction() and similar but always received errors..

Thanx
Michal

Nov 16 '05 #1
1 3948
Jax
PictureBox pb = new PictureBox()
pb.Paint += new EventHandler(MyMethod)

private void MyMethod(object sender, PaintEventArgs e

Graphics g = e.Graphics

// et
Bear in mind that this will not modify the image in the picture box, but merely paint stuff over the top of the picture box when refreshed

Hope that help

jax
Nov 16 '05 #2

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

Similar topics

4
by: Tamir Khason | last post by:
Why when I lost focus (go to back) on form all GDI+ paints disappears..... BUG or I do something wrong???? TNX
1
by: user | last post by:
hello I have: public void MyFunction(PictureBox b, PaintEventArgs e) how can i set from code this function as PaintBox Paint Event handler ? I tried: box.Paint=MyFunction() and similar but...
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...
7
by: hamil | last post by:
The following code will display a tif file on a form. When another form is moved over the tif image, the tif image is erased where the form was moved. A paint event occurs when this happens. My...
4
by: Sam | last post by:
Hai, I use a paintbox paint event to draw some images in a paintbox. I call the paint event by refreshing the paintbox using paintboxname.refresh() or paintboxname.update(). Problem with this...
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...
7
by: Rotsey | last post by:
Hi, I have a interface that I use for a form so I can pass the form to another object. How do I add the Paint event to the interface and subsequently handle the paint event in my other...
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. ...
2
by: =?Utf-8?B?UlJK?= | last post by:
Hello, I would like to add the Paint handler to the form. How to do it? Thanks in advance.
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: 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?
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.