Вниз
Скачать: CL | DM;

Странное поведение тулбара   Найти похожие ветки 

 
Переяслов Григорий ©   (2004-02-05 14:42) [0]

Привет всем.
Я создаю в рунтайме на тулбаре кнопки. И почему - то первая введенная кнопка оказывается справа (кнопки добавляются вначало тулбара), хотя хотелось бы, чтобы она оказвалась слева ( добавлялись в конец тулбара). Можно ли это сделать и как?


 
Rouse_ ©   (2004-02-05 15:39) [1]

Вот накидал тебе примерчик...

unit Unit1;

interface

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

type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
ToolBar: TToolBar;
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
Button: TToolButton;
begin
ToolBar := TToolBar.Create(Self);
ToolBar.Parent := Self;
ToolBar.ShowCaptions := True;
Button := TToolButton.Create(ToolBar);
Button.Parent := ToolBar;
Button.Caption := IntToStr(ToolBar.ButtonCount);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
Button: TToolButton;
begin
Button := TToolButton.Create(ToolBar);
Button.Parent := ToolBar;
Button.SetBounds(100000, 0, 0, 0);
Button.Caption := IntToStr(ToolBar.ButtonCount);
end;

end.


Желаю успехов


 
Переяслов Григорий ©   (2004-02-05 16:04) [2]

Спасибо, попробую. Я делал так-же, но не делал SetBounds ;-)



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.013 c
1-53572
HF-Trade
2004-02-08 22:38
2004.02.17
Form1.close; - Form2.open?


1-53622
don_dampster
2004-02-07 08:12
2004.02.17
ShellListView


1-53534
Переяслов Григорий
2004-02-05 14:42
2004.02.17
Странное поведение тулбара


9-53355
IP
2003-08-05 05:35
2004.02.17
DirectX


3-53374
Lisa
2004-01-27 18:16
2004.02.17
отлавливание ошибки при выполнении запроса




   Наверх