How to set background image for Edit (Delphi) -


how can have image editbox background ?

this possible, indeed. in form, define

private   { private declarations }   fbitmap: tbitmap;   fbrush: hbrush; protected   procedure wndproc(var message: tmessage); override;       

and do

procedure tform1.formcreate(sender: tobject); begin   fbitmap := tbitmap.create;   fbitmap.loadfromfile('c:\users\andreas rejbrand\pictures\as20utv.bmp');   fbrush := 0;   fbrush := createpatternbrush(fbitmap.handle); end; 

and

procedure tform1.wndproc(var message: tmessage); begin   inherited;   case message.msg of     wm_ctlcoloredit, wm_ctlcolorstatic:       if (message.lparam = edit1.handle) , (fbrush <> 0)       begin         setbkmode(message.wparam, transparent);         message.result := fbrush;       end;   end; end; 

of course can wrap component of own, teditex. if time over, might this. (and, notice there no need buy expensive (and maybe not high-quality) component pack third-party company.)

custom edit background http://privat.rejbrand.se/editbkg.png


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -