Google
 

Tuesday, November 6, 2007

Change glyphs of TDBNavigator Buttons

Form1 has a DBNavigator1. In the OnCreate event for the form the custom bitmap ('GoFirst') for the First button is loaded from the resource.

~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TForm1.FormCreate(Sender: TObject) ;
var
___i : Integer;
___tempGlyph : tBitmap;
begin
___tempGlyph :=TBitmap.Create;
___try
______tempGlyph.LoadFromResourceName(HInstance,'GoFirst') ;
______with DBNavigator1 do
______begin
_________for i := 0 to ControlCount - 1 do
____________if Controls[c] is TNavigateBtn then
____________with TNavigateBtn(Controls[c])
____________do begin
_______________case Index of
_______________nbFirst: Glyph := tempGlyph;
____________end;
_________end;
______end;
___finally
______tempGlyph.Free;
___end;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~

1 comment:

Anonymous said...

good...