Here's a tip many Delphi programmers may find useful:
How to get more "free" (and very useful) toolbar buttons from Windows.
1) Create a toolbar and add 15 or more buttons to it. Your form will look like this.
2) Add one line of code to the FormCreate event.
3) Run the program and the toolbar will look like this !!
The code that does this is:
procedure TForm1.FormCreate(Sender: TObject);
const
tbbitmap1: TTBAddBitmap = (hInst: HINST_COMMCTRL; nID: IDB_STD_SMALL_COLOR);
begin
SendMessage(ToolBar1.Handle, TB_ADDBITMAP, 15, integer(@tbbitmap1));
end;
All the icons that can be obtained using this technique are shown in the sample toolbar above because, each time you added a new toolbutton, Delphi incremented the ImageIndex automatically, and there are only 15 buttons in this CommCtrl set of icons.
The surprising thing is that the ImageIndex does matter (even though there is no TImageList on the form!)
Eg: If you put one button on the toolbar and set its ImageIndex to 7, then the OpenFile icon appears on it.
I'm writing this here because I initially thought these would be the images that TSysImageList provided.
It would be neat to have a TImageList that supplies this particular set of images.
Ian.