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

Change glyphs of TDBNavigator Buttons

By , About.com Guide

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

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. 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.