Change glyphs of TDBNavigator Buttons
< Continued from page 3
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;
~~~~~~~~~~~~~~~~~~~~~~~~~
Here's more DBNavigator customization: Enhancing the TDBNavigator component with modified graphics (glyphs), custom button captions, and more. Exposing the OnMouseUp/Down event for every button
Delphi tips navigator:
» Get the Height/Width of a Character (for OwnerDrawing and printing)
« Get IE favorites
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;
~~~~~~~~~~~~~~~~~~~~~~~~~
Here's more DBNavigator customization: Enhancing the TDBNavigator component with modified graphics (glyphs), custom button captions, and more. Exposing the OnMouseUp/Down event for every button
Delphi tips navigator:
» Get the Height/Width of a Character (for OwnerDrawing and printing)
« Get IE favorites
Source...