-
March 15th, 2012, 12:05 PM
#1
A way to point a progress bar to a specific time?
Hello all,
So I wondered if it is able to point a progressbar to a specific amount of time.
For example:
Start date: 10-01-2012
Current date: 15-01-2012
Finish date: 20-01-2012
So the progress bar's current value is 50% because we're half way of days.
I think this is the best explanation I can give.
Thanks
-
March 15th, 2012, 12:11 PM
#2
Re: A way to point a progress bar to a specific time?
Sure, just use PBM_SETRANGE to assign an interval that fits your need (days/hours or some other choice) and then use PBM_SETPOS to adjust it. You can also use the step functionality.
See http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
-
March 15th, 2012, 12:13 PM
#3
Re: A way to point a progress bar to a specific time?
Originally Posted by Miraclezz
Hello all,
So I wondered if it is able to point a progressbar to a specific amount of time.
For example:
Start date: 10-01-2012
Current date: 15-01-2012
Finish date: 20-01-2012
So the progress bar's current value is 50% because we're half way of days.
I think this is the best explanation I can give.
Thanks
What would be the alternative? Progress bars would set their position randomly? Of course you can position it wherever you want. Did you read the documentation?
-
March 15th, 2012, 12:22 PM
#4
Re: A way to point a progress bar to a specific time?
Originally Posted by GCDEF
What would be the alternative? Progress bars would set their position randomly? Of course you can position it wherever you want. Did you read the documentation?
You mean I read this? : http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx ?
Yes I did, but I didn't become wiser.
I need some examples if it's possible.
Start: 10-01-2012 00:00:00
Current: 15-01-2012 12:00:00
Finish: 20-01-2012 00:00:00
-
March 15th, 2012, 12:26 PM
#5
Re: A way to point a progress bar to a specific time?
-
March 15th, 2012, 12:31 PM
#6
Re: A way to point a progress bar to a specific time?
Originally Posted by S_M_A
And particularly here
and here
If you're using MFC, you'll probably find the CProgressCtrl class easier.
-
March 15th, 2012, 12:56 PM
#7
Re: A way to point a progress bar to a specific time?
Mmm,
This is the worst example.
But how to decrease a current time with a time in, for example, a textbox.
I have this 0,0
String^ listViewDate = listView1->Items->SubItems[2]->Text;
String^ DateAndTime = tsslDATEANDTIME->Text;
int ProcessToGo = listViewDate - DateAndTime;
-
March 15th, 2012, 01:09 PM
#8
Re: A way to point a progress bar to a specific time?
Originally Posted by Miraclezz
Mmm,
This is the worst example.
But how to decrease a current time with a time in, for example, a textbox.
I have this 0,0
String^ listViewDate = listView1->Items->SubItems[2]->Text;
String^ DateAndTime = tsslDATEANDTIME->Text;
int ProcessToGo = listViewDate - DateAndTime;
That code isn't appropriate for this forum. You need one of the .net forums.
-
March 15th, 2012, 08:01 PM
#9
Re: A way to point a progress bar to a specific time?
Code:
String^ listViewDate = listView1->Items->SubItems[2]->Text;
String^ DateAndTime = tsslDATEANDTIME->Text;
int ProcessToGo = listViewDate - DateAndTime;
You need to convert DateAndTime string to some Date/Time type supporting subtraction operation. Then you calculate a time span in seconds or something. Having two time spans you can calculate the progress ratio.
Best regards,
Igor
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|