473,801 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text over progressbar

Hi

Is there a way to show text in/over a progressbar (like using a label
with transparent background? Which hasn't worked for me, BTW)???

Rene

Nov 17 '05 #1
3 23192
Rene Sørensen wrote:
Hi

Is there a way to show text in/over a progressbar (like using a label
with transparent background? Which hasn't worked for me, BTW)???

Rene


override the OnPaint method, call the base, then do your own painting

John
Nov 17 '05 #2
Hi john

I did the OnPaint, (se beneath), just a small test,
but the
< call the base, then do your own painting >
you suggest, I don't exactly know what you mean about this.

This code works, but not the way I hoped, the string is drawn behind
my Progress bar control, so is there another way I can do this, or is
Graphics the wrong one to use?

private void OnPaint(object
sender,System.W indows.Forms.Pa intEventArgse)
{
Graphics G = e.Graphics;
G.DrawString( "Hello Mum!", new Font( "Verdana", 20 ),
new SolidBrush( Color.Tomato ),
650,
360 );

}

On Fri, 22 Apr 2005 22:05:54 -0400, John Davison
<no**********@y ahoo.com> wrote:
Rene Sørensen wrote:
Hi

Is there a way to show text in/over a progressbar (like using a label
with transparent background? Which hasn't worked for me, BTW)???

Rene


override the OnPaint method, call the base, then do your own painting

John

Nov 17 '05 #3
Rene Sørensen wrote:
Hi john

I did the OnPaint, (se beneath), just a small test,
but the
< call the base, then do your own painting >
you suggest, I don't exactly know what you mean about this.

This code works, but not the way I hoped, the string is drawn behind
my Progress bar control, so is there another way I can do this, or is
Graphics the wrong one to use?

private void OnPaint(object
sender,System.W indows.Forms.Pa intEventArgse)
{
Graphics G = e.Graphics;
G.DrawString( "Hello Mum!", new Font( "Verdana", 20 ),
new SolidBrush( Color.Tomato ),
650,
360 );

}


I'm sorry, I forgot ProgressBar is a sealed class. After quickly
studying the class, I could not find a way to do what you want to do.
You *could* obtain the Graphics object for the progress bar, and draw on
top of that, but you would not know when the control repaints itself,
because ProgressBar does not have a Paint event.

I think your best bet would be to create your own ProgressBar control
using the drawing primitives. I don't think that would be very difficult.

John Davison
Compass Engineering Group
Nov 17 '05 #4

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

Similar topics

5
3997
by: Basil Fenix | last post by:
I check data from a text file with a mdb Database using a progressbar and changing the Caption by % to indicate to the user what is happening.The file is large and takes quite a while. The problem though is that if the user clicks on the form everything freezes and I get "Not Responding". It is still doing the check because if you let it continue it finishes running. Thanks Basil
2
6314
by: jez123456 | last post by:
Hi, thanks for the previous advice on progressbars with showing the percentage. I would now like to create a less clunky version. I.e at the moment my progressbar shows 7 separate steps. Some steps can take seconds to process, but others could take upto 10 minutes (leaving the users thinking nothing is happening!). Is there a way to show the progressbar smoothly increasing until the final step has finished instead of clunking it's way...
1
527
by: Rene Sørensen | last post by:
Hi Is there a way to show text in / over a progressbar ( like using a label with transparent background? Which hasn't worked for me, BTW )?? Rene
1
5428
by: Mehr H | last post by:
I've been trying to figure out how i can embed a Windows.Forms.ProgressBar in my webform (aspx) file. I have tried putting a Windows.Forms.ProgressBar as public on a regular winform designer form (form called ProgressForm) and the built the dll. Then I reference this new assembly from within my asp.net applicaiton and tried to access Windows.Forms.ProgressBar from within the ProgressForm but apparently it doesn't work. Because it won't...
3
4796
by: Mitchell Vincent | last post by:
In other programming languages I've been able to easily change the style of a progress bar between smooth and blocked. I find that is either really hidden or impossible in .NET. Am I missing something? I'm shocked that .NET doesn't have a style property for the progressbar control! -- - Mitchell Vincent - kBilling - An easy and affordable billing solution
1
696
by: nobody | last post by:
Hi I'm currently developing a Windows application. At the start of the application I load several tables into datatables in a dataset. I also use a progressbar to show the user how much percent of the total is already loaded. But I do this in a dirty way: I increment the progressbar with the same number after each table, but not all tables contain the same amount of data. I solved this with starting an other thread to increment the...
7
11048
by: TheGanjaMan | last post by:
Hi people, I'm stuck on a problem and I was wondering if there was a way around: I'm trying to find the number of lines in a comma delimited text file. I have a progress bar that should display the progress of a text file that is being read into a DataGridView. I would like the progressbar to progress as the lines of data are being read. But to set the maximum value for the progress bar I would need to know the
2
2605
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, I have a Label on a Windows form (Version 1.1.4322) and while I iterate recursively through a method I want to show the name of the current file being copied to another directory. The Label is not visible until the backup begins, at which point I resize the form to show the Label and a ProgressBar. As each file is copied, the Label is updated:
4
2513
by: sivamoorthy | last post by:
how to use a progressbar in a one cpp file but defined in another header file. the function in which i am using is a static member function. how to use the progressbar inside the function code: file name : flash.cpp void CFlasher::OnStartDownload (void *pDublicate) { bValueRet = DeviceIoControl (hHandle, \ (DWORD) IOCTL_SCUSBDFU_DETACH, NULL, \
0
9556
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10516
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10262
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10052
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
6829
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
5479
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
5616
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4156
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.