Mega Code Archive

 
Categories / Delphi / Examples
 

Progressbar

Subject: RE: ProgressBar in StatusPanel Thanks for the tip Mor+ol (sorry about the name, that's the way it transmitted). There's one typo (csAcceptsControls) and you'd probably want to include the default ControlStyle options: unit LMyStatusBar; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls; type TMyStatusBar = class(TStatusBar) private { Private declarations } protected { Protected declarations } public constructor Create(AOwner: TComponent); override; published { Published declarations } end; procedure Register; implementation procedure Register; begin RegisterComponents('Win32', [TMyStatusBar]); end; constructor TMyStatusBar.Create(AOwner: TComponent); begin inherited Create(AOwner); ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents, csDoubleClicks, csSetCaption]; end; end. That's all there is to it. An instance of this StatusBar will accept ProgressBars, Buttons, Images, Labels, etc., you just have to adjust the size of the controls to fit inside the restricted space of the StatusBar (e.g. for a ProgressBar set Top to 3 and Height to 15 and Left to 0 if you want it flush with the left side of the ProgressBar or wherever you want it to appear.) I think it's certainly easier than handling an OwnerDrawn StatusBar. Steve Helgeson Lamplighter Software -----Original Message----- From: owner-delphi@Kyler.com [mailto:owner-delphi@Kyler.com]On Behalf Of Mor+ol Marian Sent: Friday, March 26, 1999 7:23 AM To: 'Delphi@Kyler.com' Subject: RE: ProgressBar in StatusPanel 1)Use one of many komponents on DSP or Torry ... or 2) Define TMyStatusBar inherited from TStatusBar with ControlStyle csAcceptControls ad2) I didn't try it but it should work. Excuse my English. Many successes. > -----P•vodn_ zprßva----- > Od: Disch [SMTP:ba1653@fen.baynet.de] > Odeslßno: 26. b°ezna 1999 11:37 > Komu: delphi@kyler.com > P°edm_t: ProgressBar in StatusPanel > > Hi all, > > how can I make put a TProgressBar (or any other VC) into a TStatusBar? > > Help would be great, thanks > Wolfgang Disch > > > **************************************************** > If you don't want to see any more of these messages, > send a message to: MajorDomo@Kyler.com > with a message of: UNSUBSCRIBE delphi