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

How do I force a repaint from a custom control?

I am making a custom control (a ProgressBar) and was wondering how do
I force the control to paint like the base ProgressBar does? As it is
my control doesn't paint until the main execution loop let's it,
usually with Application.DoEvents. But even if I do an
Application.DoEvents() in my OnPaint it doesn't paint the control.
Thanks,

Tom P.
Feb 28 '08 #1
1 5988
Hi Tom,

Hmm, is it a WinForms app? Anyway, you need to use sort of threads approach
to "live update" your progress bar. The links below can help you:
http://www.eggheadcafe.com/software/...date-from.aspx
http://msdn.microsoft.com/msdnmag/is...dvancedBasics/

Regards, Alex
[TechBlog] http://devkids.blogspot.com
ProgressBar

Feb 28 '08 #2

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

Similar topics

2
by: Morten Wennevik | last post by:
In the middle to a heavy recursive loop, can you pause and force a message check? -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
3
by: jerry chapman | last post by:
Based on a mouse click I change something on the screen. I then want to repaint the screen to show the change. When I tried to use .Invalidate in my mouse routine, I got a compilation error. ...
4
by: CroDude | last post by:
I've made a custom groupbox control. Inside, as one of it's members is CSimpleGradient object. CSimpleGradient is a wrapper class for gradient usage. Basically it looks like that: public class...
3
by: Arulraja | last post by:
Hello, I have created 2 custom server controls, The parent custom control contains multiple child custom controls. The Child control has a button on it. If I Click the button control, it...
4
by: MLH | last post by:
Setting form's Picture property to another file from within VBA doesn't repaint the form with new bitmap - for instance... Me.Picture = "c:\pics\MyNewPic.jpg" I tried Me.Repaint afterward,...
6
by: Shawn | last post by:
Any ideas how I can have a button click on one open page force a postback on a different page.
3
by: --== Alain ==-- | last post by:
Hi, As i did not get any answer to my previous post, i post the topic again. How can i repaint my control, when an item from my custom control collection has changed ? in my collection...
0
by: philaphan80 | last post by:
Is there a way to force the Visual Studio IDE (Page Control at design- time) to refresh / repaint itself upon drag & drop of *any* item from the toolbox? Perhaps a method I need to override within...
0
by: 123456mmmmmm | last post by:
Hi, I have a problem with Repaint my control. At first my control Create correctly. But with every changes like move scroll or anythings else my contrlo will be repaint. How can I avoid repainting...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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
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...

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.