delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi







Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (1)


Changing DbNavigator's IconsFormat this article printer-friendly!Bookmark function is only available for registered users!
want to change the classic icons from dbnavigator ??
Product:
Delphi 3.x (or higher)
Category:
DB-General
Skill Level:
Scoring:
Last Update:
01/31/2002
Search Keys:
delphi delphi3000 article borland vcl code-snippet Icon DbNavigator TdbNavigator Changing
Times Scored:
7
Visits:
4357
Uploader: Matheus Pecci
Company:
Reference: N/A
 
Question/Problem/Abstract:
how can I change the icons from a DbNavigator ??
Answer:



First, put a DbNavigator in your form and configure it normally with your data source.
Go in the source code of the form and create a new data type before the class created to the form; like this:


type
    NewTypeNav = class( TDbNavigator );
    TForm1 = class(TForm);
  

After this, go to the event OnCreate of this form and put the following code:


var
     c:Tbitmap;
begin
    c:=Tbitmap.Create;
    c.LoadFromFile('C:\Insert.bmp');
    newtypenav(dbnavigator1).buttons[nbinsert].Glyph:=c;

In this case, just the icon of the button Insert will be changed. To change all buttons, repeat theses 3 lines changing the bitmap name and the button's variables.
Here is the Variables:

NbFirst - Button First
NbPrior - Button Prior
NbNext - Button Next
NbLast - Button Last
NbInsert - Button Insert
NbDelete - Button Delete
NbEdit - Button Edit
NbPost - Button Post
NbRefresh - Button Refresh


TIP: This Example show how to load the picture for the button from a Bitmap File, If you whish, you can put a TImage for each image in your form and load the images in project time, reducing the source code for load the images. Replacing that 3 lines for just 1.

    newtypenav(DbNavigator).buttons[nbprior].Glyph:=Form1.Imgprior.picture.bitmap;






Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
i have another method do it .
    t fp (Feb 5 2002 3:49PM)

I find your method not is a good way ,

you know ,  can find the TDbNavigator 's Unit , and you can
  find it use a resource file , then can recreate this Resource file
  change every button 's bitmap ,  and save as  another dirctory
  
don't forget set the libary search path in your delphi IDE envoirment

then  put a TDbNavgator component  to  a simple form ,  run
  
you can find it ' icon changed  ,
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
M. Maes
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)