More on ProgressBars

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

More on ProgressBars

Postby Sailor » Sun Jan 23, 2005 10:54 am

I am trying to place a ProgressBar in the second panel in a StatusBar and have desperately tried to modify the code given in: http://bcbjournal.org/articles/vol1/970 ... s_bars.htm, with the following code:

ProgressBar = new TProgressBar(StatusBar1);
ProgressBar->Parent = StatusBar1;
ProgressBar->Left = 2;
ProgressBar->Top = 4;
ProgressBar->Height = 13;
ProgressBar->Width =
StatusBar1->Panels->Items[0]->Width - 4;

which places the ProgressBar in the FIRST panel..

Any tip to get it to the second?
Sailor
 

Postby Lars » Sun Jan 23, 2005 11:58 am

The ProgressBar is actually not contained within the first panel, even though it appears that way. Just increase the left coordinate of the ProgressBar and it will move up to the right. Just move it far enough so it appear to be placed in the second panel, e.g.:
Code: Select all
    // Create progress bar, setting the status bar
    // as the parent and owner.
    TProgressBar *ProgressBar = new TProgressBar(StatusBar1);
    ProgressBar->Parent = StatusBar1;
    ProgressBar->Left = StatusBar1->Panels->Items[0]->Width + 4;
    ProgressBar->Top = 4;
    ProgressBar->Height = 13;
    ProgressBar->Width = StatusBar1->Panels->Items[1]->Width - 4;

    // Just so it shows better...
    ProgressBar->Position = ProgressBar->Max;
Lars
 

RE

Postby Sailor » Thu Jan 27, 2005 8:44 am

hmm.. a smart trick...!

Thanks again Lars
Sailor
 


Return to Technical

Who is online

Users browsing this forum: Bing [Bot] and 19 guests