|
| Display DBNavigator's Buttons' caption | 
|
|---|
| DBNavigator has only Icons, but no captions | Product: Delphi 5.x (or higher) | Category: Component Writing | Skill Level:
 | Scoring:  | Last Update: 04/01/2002 | Search Keys: delphi delphi3000 article borland vcl code-snippet DBNavigator TDBNavigator Captions Robert zxg | Times Scored: 2 | Visits: 3278 | Uploader: Robert zxg Company: ChinaBird | Reference: N/A | | | Question/Problem/Abstract:
My customers complain that they feel puzzled about those buttons'
functions, and they hate to wait for "hint"s. :(
| Answer:
{Define a new class as a desendant of TDBNavigator, and assign captions to TDBNavigator's buttons}
type
TZxgDBNavigator = class(TDBNavigator)
private
//...
public
Constructor Create(Aowner:Tcomponent); override;
//...
end;
const
DefaultCaptions: array[TNavigateBtn]of string=('FIRST', 'PRIOR', 'NEXT',
'LAST', 'INSERT', 'DELETE', 'EDIT', 'POST', 'CANCEL', 'REFRESH');
// You Can Define DefaultCaptions in your native language, e.g.
// Chinese Version is --
{
DefaultCaptions: array[TNavigateBtn]of string=('Æðʼ','Ïòǰ','Ïòºó',
'ĩβ','²åÈë','ɾ³ý','±à¼','±£´æ','È¡Ïû','Ë¢ÐÂ');
}
//...
constructor TZxgDBNavigator.Create(Aowner:Tcomponent);
var
lp:TNavigateBtn;
begin
inherited create(Aowner);
for lp:=low (TNavigateBtn)to high(TNavigateBtn)do
buttons[lp].Caption:=DefaultCaptions[lp];
end;
//...
|
|
|
| |
Sign up to consume product discounts for Bronze memberships !
|
|
| |
Community Ad of E. Irigoyen |
|
| |
|
|
|