Registriert seit: 31. Okt 2003
1.120 Beiträge
Delphi 7 Personal
|
Re: "echter" Dropdown-Toolbutton...
11. Jan 2004, 22:45
So gehts:
Delphi-Quellcode:
uses
CommCtrl; // Nicht vergessen und nicht mit ComCtrls verwechseln
procedure TBSetWholeDropDown(hTB : THandle; iButton : integer);
var
tBB : TTBBUTTON;
tBI : TBBUTTONINFO;
const
BTNS_WHOLEDROPDOWN =$0080;
begin
FillChar(tBB, SizeOf(tBB), 0);
SendMessage (hTB, TB_GETBUTTON, iButton, Integer(@tBB));
FillChar(tBI, SizeOf(tBI), 0);
tBI.cbSize := SizeOf(tBI);
tBI.dwMask := TBIF_STYLE;
SendMessage(hTB, TB_GETBUTTONINFO, tBB.idCommand, Integer(@tBI));
tBI.fsStyle := tBI.fsStyle or BTNS_WHOLEDROPDOWN;
SendMessage(hTB, TB_SETBUTTONINFO, tBB.idCommand, Integer(@tBI));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
TBSetWholeDropDown(ToolBar1.Handle, 0);
end;
Wobei iButton der Index des Buttons ist.
|
|
Zitat
|