Board index » delphi » Toolbar Button Captions...

Toolbar Button Captions...

(D4.03)  How can I create a toolbar button like the ones in Outlook
Express, where the caption is split over two lines?

Compose      Reply to
Message      Author

etc.

As soon as you turn on the toolbar's ShowCaptions property, it resizes
the buttons, and then prevents you from resizing them.  That sound like
a bug to me - it shouldn't be resizing buttons unless you've set them
to AutoSize.

Is there any way round this?

Colin
e-mail :co...@wilsonc.demon.co.uk
web: http://www.wilsonc.demon.co.uk/delphi.htm

 

Re:Toolbar Button Captions...


Here is an example:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
  StdCtrls, ToolWin, ComCtrls, Buttons;

type
  TForm1 = class(TForm)
    ToolBar1: TToolBar;
    Button1: TButton;
    BitBtn1: TBitBtn;
    SpeedButton1: TSpeedButton;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Button1.Caption := 'Compose'#$0A'Message'; // doesn't work
  BitBtn1.Caption := 'Compose'#$0A'Message'; // works
  SpeedButton1.Caption := 'Compose'#$0A'Message'; // works
end;

end.

On Wed, 10 Mar 1999 09:33:32 GMT, Colin Wilson

Quote
<co...@wilsonc.demon.co.uk> wrote:
>(D4.03)  How can I create a toolbar button like the ones in Outlook
>Express, where the caption is split over two lines?

>Compose      Reply to
>Message      Author

>etc.

>As soon as you turn on the toolbar's ShowCaptions property, it resizes
>the buttons, and then prevents you from resizing them.  That sound like
>a bug to me - it shouldn't be resizing buttons unless you've set them
>to AutoSize.

>Is there any way round this?

>Colin
>e-mail :co...@wilsonc.demon.co.uk
>web: http://www.wilsonc.demon.co.uk/delphi.htm

Other Threads