473,396 Members | 1,853 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.

custom GDI+ component and OnPain

Hi

I'm making a custom component using GDI+, a calendar grid thingy. I paint
the grid and numbers in my overrided OnPaint. However, when i go to paint
other things at other times in other functions, like cute little rectangles
or fancy text, it calls OnPaint and I'm fairly sure it's painting over what
i just painted 3 nanoseconds ago, coz nothing is appearing. Good way around
this prob?

cheers
dave

--
Question Authority! (Then do exactly what it tells you)
Nov 16 '05 #1
1 1686
Never paint in anything EXCEPT the OnPaint call. I suspect you're doing
something clever like painting in a click-event or timer by using the
CreateGraphics call.

See the GDI+ FAQ most asked question for why this is going to be a paintful
experience for you.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"David Sobey" <ma**********@hotmail.com> wrote in message
news:41***********************@news.optusnet.com.a u...
Hi

I'm making a custom component using GDI+, a calendar grid thingy. I paint
the grid and numbers in my overrided OnPaint. However, when i go to paint
other things at other times in other functions, like cute little rectangles or fancy text, it calls OnPaint and I'm fairly sure it's painting over what i just painted 3 nanoseconds ago, coz nothing is appearing. Good way around this prob?

cheers
dave

--
Question Authority! (Then do exactly what it tells you)

Nov 16 '05 #2

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

Similar topics

0
by: ttupper | last post by:
I have made a custom control that has a property that is a custom component. When I put the custom control on a form in the designer, the propery is listed in the Properties window with a default...
2
by: Aaron | last post by:
I am kind of new the BizTalk 2004, can someone tell me how I can test my custom (decode) pipeline component in BTS 2004?
1
by: Richard | last post by:
I have a lot of colors, fonts, etc. to set for rows and possibly columns, based on the information contained in the row and/or the selected row. A main one is putting a border around the entire...
5
by: ross kerr | last post by:
Hi All, I am extending the combobox to create a control that selects an item based on the text the user is typing into the text area of the control. I have an issue that occurs only when i...
1
by: Sakkatha | last post by:
Hi gourp Is it possible to register a custom web component foo.ascx in the code behind page???
5
by: sean.gilbertson | last post by:
Hi, I'm sort of new to ASP.NET 2.0 and ASP.NET in general. I have some data that I would like to display in a tabular format, but I'm going to be generating the columns dynamically, and I would...
0
by: rdlkino | last post by:
I'd like to ask you which is the right way to create a new JSF component that supports children. I mean like the "dataTable" component where you can insert for example the "column" component/tag....
0
by: Alex0035 | last post by:
If you add "User Control","Component Class" or "Custom Control" component, in some cases VS 2005 doesn't display new component in the toolbox tool bar. To activate this option select in...
3
by: KennethLundin | last post by:
Hi, i'm developing a solution in VS9/CSharp. Now I'm constructing a deployment project for my appliation (thick, database driven, winforms, standard, good old type of application). During...
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.