473,799 Members | 3,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1696
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**********@h otmail.com> wrote in message
news:41******** *************** @news.optusnet. com.au...
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
1561
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 value of (none). I then put the custom component on the form and it goes in the Component tray like it is supposed to. I then drop down the property on the custom control and the only value ni the list is (none).
2
1463
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
1455
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 selected row only. The border one does not seem to be simple thing to do by just setting a property of the grid, DataGridTableStyle, GridColumnStyle, etc. It seems to require GDI stuff like Paint, Brush, Region, Rectangle, etc. Is there an easier way...
5
2155
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 drop down the combo box as the users typing. When the on leave event is fired the value in the selected
1
1343
by: Sakkatha | last post by:
Hi gourp Is it possible to register a custom web component foo.ascx in the code behind page???
5
1363
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 like to make it so that each row can be expanded downward dynamically to show detailed information. So far, it seems like I'll have to use an asp:Table and generate the entire thing in code -- including the Javascript to hide and show the
0
1285
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. I created a new Table component that is extending UIData, it derives from an a JSP component. It is simple for me to extend capabilities of this table by adding attributes to the tag. But my new problem is how to support nested tag inside my...
0
1040
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 Tools->Options->Windows Forms Desiner, choose "True" in "AutoToolBoxPopulate"option.
3
5859
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 installation I also install the PostgreSQL database and along with that I need to execute some Custom Actions. I've created a Custom Installer component in CSharp and calls it on Install/Rollback/ uninstall and everything works great (Custom Actions...
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10029
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9077
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6808
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.