bab_mail

TDBNavigator

Nov 13th, 2013
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.10 KB | None | 0 0
  1. procedure ChangeDBNavImage(DBnav: TDbNavigator);
  2. var
  3. i: Integer;
  4. tempGlyph: TBitmap;
  5. ExePath: string;
  6. begin
  7. ExePath := ExtractFilePath(Application.ExeName);
  8. tempGlyph := TBitmap.Create;
  9. try
  10. with DBNav do
  11. begin
  12. for i := 0 to ControlCount - 1 do
  13. begin
  14. if Controls[i].ClassName = 'TNavButton' then
  15. begin
  16. case TNavButton(Controls[i]).Index of
  17. nbFirst: tempGlyph.LoadFromFile(ExePath + 'first.bmp');
  18. nbPrior: tempGlyph.LoadFromFile(ExePath + 'previous.bmp');
  19. nbNext: tempGlyph.LoadFromFile(ExePath + 'Next.bmp');
  20. nbLast: tempGlyph.LoadFromFile(ExePath + 'Last.bmp');
  21. nbInsert: tempGlyph.LoadFromFile(ExePath + 'Insert.bmp');
  22. nbDelete: tempGlyph.LoadFromFile(ExePath + 'Delete.bmp');
  23. nbEdit: tempGlyph.LoadFromFile(ExePath + 'Edit.bmp');
  24. nbPost: tempGlyph.LoadFromFile(ExePath + 'Post.bmp');
  25. nbCancel: tempGlyph.LoadFromFile(ExePath + 'Cancel.bmp');
  26. nbRefresh: tempGlyph.LoadFromFile(ExePath + 'Refresh.bmp');
  27. end;
  28. TNavButton(Controls[i]).Glyph := tempGlyph;
  29. end;
  30. end;
  31. end;
  32. finally
  33. tempGlyph.Free;
  34. end;
  35. end;
  36. procedure TForm1.Button1Click(Sender: TObject);
  37. begin
  38. ChangeDBNavImage(DBNavigator1);
  39. end;
Advertisement
Add Comment
Please, Sign In to add comment