GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 06-Sep-2004, 03:32
m_dale m_dale is offline
New Member
 
Join Date: Sep 2004
Posts: 2
m_dale is on a distinguished road

How to add progress text to an MFC progress control?


I'm currently learning MFC using Visual C++.
I have a progress control and I was wanting to add text to it to show the current status in percent. Much to my surprise, this was not a standard option!

I can position a static text control over the progress control and update it without any issues, and this would be fine, except that the text does not invert.
On all the progress bars i've seen (setup wizards and the like), when the progress text is not covered by the bar it is black (or whatever colour the bar is), and when it is covered by the bar it is white. Obviously this improves readability greatly.

Does anyone know how I can go about doing this?
  #2  
Old 07-Sep-2004, 00:22
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 1,031
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
Quote:
Originally Posted by m_dale
I'm currently learning MFC using Visual C++.
I have a progress control and I was wanting to add text to it to show the current status in percent. Much to my surprise, this was not a standard option!

I can position a static text control over the progress control and update it without any issues, and this would be fine, except that the text does not invert.
On all the progress bars i've seen (setup wizards and the like), when the progress text is not covered by the bar it is black (or whatever colour the bar is), and when it is covered by the bar it is white. Obviously this improves readability greatly.

Does anyone know how I can go about doing this?

Yeah, VC 6 is starting to be a drag at UI programming :-( . The only "solution" I am aware of is to do just that!
You'll have to compute yourself the position of your text reported to the static control, and it's respective position reported to the filling in the progress bar. So, when the filling reaches the position of your text, you'll have to do the inverting yourself .
If there is a better way out there, please let me know!

Regards,
Luci
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
  #3  
Old 08-Sep-2004, 03:00
m_dale m_dale is offline
New Member
 
Join Date: Sep 2004
Posts: 2
m_dale is on a distinguished road
Nope, there's no better way it seems.
I just had to learn device contexts in a hurry.
Oh well, it works - now I just have to subclass it properly from the CProgressCtrl class.
  #4  
Old 07-Jan-2005, 02:25
Nagesh Nagesh is offline
New Member
 
Join Date: Jan 2005
Posts: 1
Nagesh is on a distinguished road

creating a progressbar with text


Hi
can u pls tell me how u created the progressbar with text inside even i am facing the same problem.
 
 

Recent GIDBlogNot selected for officer school by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
burning problems PLEASE PLEASE HELP kelticeire Computer Hardware Forum 4 01-Dec-2006 15:39
CD burner wont burn!! robertli55 Computer Hardware Forum 1 18-Jun-2004 10:53
Yet another CD burner problem: Lite-On LSC-24082K Erwin Computer Hardware Forum 1 22-May-2004 11:28
Scrolling Text Ads - Free advertising on other peoples sites jrobbio Advertising & Affiliates Forum 0 19-Feb-2003 00:00

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:51.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.