 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
brent d. shelton Guest
|
Posted: Thu Dec 16, 2004 4:52 pm Post subject: DBEdit |
|
|
Does anyone know how to change the position that the text in an edit
appears? I'd like to move the text a few pixels up. I'm a newbie on
component writing, so any help would be appreciated.
Thanks,
Brent
|
|
| Back to top |
|
 |
raffels Guest
|
Posted: Fri Dec 17, 2004 6:48 pm Post subject: Re: DBEdit |
|
|
Uzytkownik "brent d. shelton" <tech (AT) imppub (DOT) com> napisal w wiadomosci
news:MPG.1c2b8755829e2ae8989680 (AT) news (DOT) chartertn.net...
| Quote: | Does anyone know how to change the position that the text in an edit
appears? I'd like to move the text a few pixels up. I'm a newbie on
component writing, so any help would be appreciated.
Thanks,
Brent
|
unit EditTest2;
interface
uses
SysUtils, Classes, Controls, StdCtrls, Graphics,Messages,Windows, Forms;
type
TEditTest2 = class(TEdit)
private
procedure WMPAINT(var Message: TMessage); message WM_PAINT;
{ Private declarations }
protected
procedure Change; override;
procedure DoEnter; override;
procedure DoExit; override;
{ Protected declarations }
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
constructor TEditTest2.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
BorderStyle:=bsNone;
Ctl3D:=False;
end;
destructor TEditTest2.Destroy;
begin
inherited Destroy;
end;
procedure TEditTest2.WMPAINT(var Message: TMessage);
var
dc: HDC;
begin
inherited;
dc := getDC(handle);
with TCanvas.create do begin
Handle := dc;
Brush.Color := clWhite;
//Pen.Color:=clBlue;
//Font.Style := [fsItalic,fsBold];
//Font.Color:=clBlue;
FillRect(rect(0,0,clientwidth,clientheight));
TextOut(10,1,text); // 10 pixels to right
Handle := 0;
free; //the canvas.
ReleaseDC(handle,dc);
end;
end;
Procedure TEditTest2.Change;
begin
inherited
// repaint;
end;
Procedure TEditTest2.DoEnter;
begin
inherited
// repaint;
end;
Procedure TEditTest2.DoExit;
begin
inherited
repaint;
end;
procedure Register;
begin
RegisterComponents('Standard', [TEditTest2]);
end;
raffels
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|