摘要:
网格(Grid)控件,可直观描述二维信息。因此它具有横向和纵向二轴,就是一个二维表格。1、TCustomGrid为所有网格控件的父类,定义了网格控件的主要特征和网格控件的主要功能。在这里,我们着重要了解的是它的两个保护级(protected)方法:(1)procedure Paint;所有TWinControl的子类都可通过Paint来绘制自身外形。在TCustomGrid.Paint中,主要实现两个功能:绘制网格线和填充网格数据。其中,网格数据的填充具体实现由下述的DrawCell完成。在后面的内容,我会结合源代码详细解释Paint。2)procedure DrawCell(ACol, AR 阅读全文
posted @ 2008-07-18 17:46
delphi中间件
阅读(416)
评论(0)
推荐(0)
摘要:
function GetNumFromStr(const str: String;const hex:boolean=false): String;vari:integer;charset:Set of char;beginif hex thencharset:=['0'..'9','a'..'f','A'..'F','.']elsecharset:=['0'..'9','.'];for i := 1 to Length(str) do 阅读全文
posted @ 2008-07-18 16:34
delphi中间件
阅读(428)
评论(0)
推荐(0)
摘要:
function SaveAsExcelFile(StringGrid: TStringGrid; FileName: string):boolean;const xlWBATWorksheet = -4167;var Row, Col: integer; GridPrevFile: string; XLApp, Sheet: OLEVariant;begin Result := false; XLApp := CreateOleObject('Excel.Application'); try XLApp.Visible := False; XLApp.Workbooks.Ad 阅读全文
posted @ 2008-07-18 16:27
delphi中间件
阅读(408)
评论(0)
推荐(0)
摘要:
delphi操作word一、Delphi程序启动Word采用CreateOleObjects的方法来启动Word,调用VBA代码,具体实现过程为:首先使用GetActiveOleObject('Word.Application')判断当前内存中是否存在Word程序,如果存在,则直接连接,如果没有Word程序,则使用CreateOleObject('Word.Application')启动Word二、Delphi程序新建Word文稿格式:WordDocuments.Add(Template,NewTemplate,DocumentType,Visible)Temp 阅读全文
posted @ 2008-07-18 09:15
delphi中间件
阅读(1000)
评论(0)
推荐(0)

浙公网安备 33010602011771号