1. Home
  2. Computing & Technology
  3. Delphi Programming

Change glyphs of TDBNavigator Buttons

By Zarko Gajic, About.com

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

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2001 Delphi Tips
  7. Change glyphs of TDBNavigator Buttons

©2009 About.com, a part of The New York Times Company.

All rights reserved.