BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DBEdit

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.components.writing
View previous topic :: View next topic  
Author Message
brent d. shelton
Guest





PostPosted: Thu Dec 16, 2004 4:52 pm    Post subject: DBEdit Reply with 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
Back to top
raffels
Guest





PostPosted: Fri Dec 17, 2004 6:48 pm    Post subject: Re: DBEdit Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.components.writing All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.