![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#6
|
|||
|
|||
|
Delphius:
eso intente hacer pero me da un explote, tengo puesto este codigo. //aqui defino la clase unit Unit2; interface Type TNumeros = class private protected Fa: integer; Fb: integer; public constructor Create(_Fa, _Fb: integer); function Suma: integer; property A:integer read Fa write Fa; property B:integer read Fb write Fb; published end; implementation { TNumeros } constructor TNumeros.Create(_Fa, _Fb: integer) begin Self.Fa:=_Fa; Self.Fb:=Fb; end; function TNumeros.Suma: integer; begin Result:=Fa + Fb; end; end. //aqui defino la parte de la forma unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Unit2, StdCtrls; type TForm1 = class(TForm) Edit1: TEdit; Edit2: TEdit; Button1: TButton; Edit3: TEdit; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } numeros: TNumeros; end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin numeros.Create(StrToInt(Edit1.Text), StrToInt(Edit2.Text)); Edit3.Text:=IntToStr(numeros.Suma); end; end. mira a ver y dime que podria ser. gracias |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Delphi VS Visual Basic | woody | Debates | 137 | 18-03-2008 14:54:00 |
| Delphi V/s Visual Basic | lavtaro | Varios | 13 | 02-05-2006 14:30:47 |
| Creando componente visual | piccolo2101 | Varios | 4 | 25-01-2006 14:13:45 |
| Problema con librería en Visual C++ | llauraff | Varios | 0 | 16-09-2004 14:36:20 |
| Tablas dbf-fpt (¿Visual Fox Pro?) | ogorut | Tablas planas | 2 | 24-11-2003 10:04:22 |
|