怎样把面向对象的方法用到delphi里去?(50分)

  • 主题发起人 主题发起人 tt123tt
  • 开始时间 开始时间
T

tt123tt

Unregistered / Unconfirmed
GUEST, unregistred user!
1)如题;
2)怎么用dll?
3)怎样用ActiveX?
有没有这方面的典型例子?
 
www.2ccc.com上有一份《delphi讲义》对这些问题都讲的比较明确!
 
Delphi不是面向对象编程吗?
找几本书看看!
 
unit ClassInput;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, DBCtrls, DBTables, Db, Grids, Wwdbigrd, Wwdbgrid, wwTrDBGrid,
Mask, wwdbdatetimepicker, wwdblook,wwdbedit;
Type
TClassInput=class
private
// qry_prim:Tquery;
FTbName:string
CForm:Tform //当前窗体
DBName:string;
state:string;
PrimaryKeyChange:boolean;

published
Function GetTbname():string;
procedure SetTbName(TbNam:string);
property TbName : string read GetTbName write SetTbName;
property SetCForm : Tform read CForm write CForm;
property SetDBName : string read DBName write DBName;
property SetState: String read state write State;
property SetPrimaryKeyChange:boolean read PrimaryKeyChange write PrimaryKeyChange;

Public

Constructor create(Form:TForm;dataBaseName:string;STbName:string);
destructor Destroy();Override

function CheckNull(TitleText,InputBoxName:string):boolean
//空值校验

function CheckPrimaryKey(KeyName:string;KeyValue:string):boolean;overload;//主键校验验
function CheckPrimaryKey(KeyName,KeyValue,KeyName2,KeyValue2:string):boolean;overload;
function CheckPrimaryKey(KeyName,KeyValue,KeyName2,KeyValue2,
KeyName3,KeyValue3:string):boolean;overload;

function CheckDigit(sender: Tobject
Width, dec: integer;
var key1: char): boolean;//校验输入的数字
function CalcFieldName(FTable,FieldName,FieldValue,FindField:string):string;//为计算字段赋值
function DeptNam(deptNum:string): string;
function EmpNam(EmpNum:string) : string;
function UserCodeToEmpNam(UserCode:string): string;
function MaxValue(FieldName:string):string;
function CreateID(BeginPos:Integer =1;StrID:string='';TieleText:string =''):string;
procedure GetUsedItem(qry_Item:Tquery;TableName:string);//取得可用的值ISUSE=1
procedure Del(qry_del:Tquery)
overload;
procedure Del(TBL_DEL:TTable)
overload;
procedure MyMessage(S:string)
//对话框;

end;
 
junjun2003:
但在编程时很小想用面向对象的方法写代码,怎样写代码时用上面向对象的方法?
 
尝试自己写一个控件就明白了.
 
同意AirSupply,
自己写了一个控件以后对面向对象的思想肯定很清楚了
我也在学习中。。。
 
多人接受答案了。
 
后退
顶部