![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#4
|
|||
|
|||
|
Componente Shape con Imagen Evento y texto.
unit shape1;
interface uses Windows, Messages, graphics, SysUtils, Classes, Controls, ExtCtrls; type oNCLICKEVENTO =procedure(Sender:TObject) of object; tshape1 = class(TShape) private FOnClick: oNCLICKEVENTO; FCaption:string; Fbitmat:tbitmap; procedure CMMouseClick(var msg:TMessage);//; message CM_MOUSECLICK; { Private declarations } protected { Protected declarations } public { Public declarations } published Property Tcaption:string read Fcaption write fcaption ; property OnClick: oNCLICKEVENTO read FOnClick write FOnClick ; Property bitmat:Tbitmap read fbitmat write fbitmat; procedure LLenaimagen(x:String); { Published declarations } end; procedure Register; implementation unit shape1; interface uses Windows, Messages, graphics, SysUtils, Classes, Controls, ExtCtrls; type oNCLICKEVENTO =procedure(Sender:TObject) of object; tshape1 = class(TShape) private FOnClick: oNCLICKEVENTO; FCaption:string; Fbitmat:tbitmap; procedure CMMouseClick(var msg:TMessage);//; message CM_MOUSECLICK; { Private declarations } protected { Protected declarations } public { Public declarations } published Property Tcaption:string read Fcaption write fcaption ; property OnClick: oNCLICKEVENTO read FOnClick write FOnClick ; Property bitmat:Tbitmap read fbitmat write fbitmat; procedure LLenaimagen(x:String); { Published declarations } end; procedure Register; implementation procedure TShape1.CMMouseClick(var Msg:TMessage); begin inherited; if Assigned (FOnClick) then FOnClick(Self); end; procedure TShape1.LLenaimagen(x:string); var Bitmap: TBitmap; begin Bitmap := TBitmap.Create; try Bitmap.LoadFromFile(x); Canvas.Brush.Bitmap := Bitmap; Canvas.FillRect(Rect(0,0,100,200)); finally Canvas.Brush.Bitmap := nil; Bitmap.Free; end; end; procedure Register; begin RegisterComponents('Additional', [tshape1]); end; end. |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Eliminarcero a la izquierda | cacu | OOP | 1 | 11-11-2007 19:50:42 |
| José Saramago:la izquierda ha dejado de ser izquierda | marcoszorrilla | La Taberna | 3 | 15-06-2007 19:02:49 |
| El zero a la izquierda | [Gunman] | PHP | 4 | 12-07-2006 08:56:38 |
| Navegar en un DBgrid de izquierda a derecha | amadis | Conexión con bases de datos | 1 | 17-01-2006 12:53:32 |
| como pooner 0 en la izquierda | Michel | Firebird e Interbase | 6 | 29-07-2003 15:09:09 |
|