473,801 Members | 2,369 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 23191
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
9697
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
10515
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...
0
10291
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...
1
10260
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
10049
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
9100
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...
1
7589
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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?

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.