07 2011 档案
delphi键盘按钮参数
摘要:分别在FormCreate,FormKeyPress下编写一句代码就可以了如下:procedure TForm1.FormCreate(Sender: TObject);beginkeypreview:=true; //可以接收键盘操作end;procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);beginif key = #27 then application.terminate; //关闭程序end;#13 回车#10换行#20为空格键盘常用ASCII码(delphi)键盘常用ASCII码(delphi) ESC键 V
阅读全文
delphi建立mdi窗口 多页面管理
摘要:Form1中加Panel1,Panel1的属性DockSite设为True,Form2的属性DragKind设为dkDock, DragMode设为dmAuromatic在Form1的OnShow中加:Form2:= TForm2.Create(self);Form2.ManualDock(Panel1, nil, alclient);form2.FormStyle:=fsStayOnTop;Form2.Show;如果是pagecontrolForm2.ManualDock(pagecontrol1, nil, alclient);
阅读全文
AdvPageControl或者pagecontrol 动态建立新页面
摘要:var tab1:TadvTabSheet;begin tab1:=TadvTabSheet.Create(self); tab1.Caption:='供应商资料'; tab1.AdvPageControl:=ap1;pagecontroltab1:=TTabSheet.Create(self); tab1.Caption:=timetostr(time); tab1.PageControl :=PageControl1
阅读全文
左键双击关闭pagecontrol中的一个分页即一个tabsheet,功能像遨游浏览器一样
摘要:左键双击关闭pagecontrol中的一个分页即一个tabsheet,功能像遨游浏览器一样procedure TfrmServerSetup.PageControl1MouseDown(Sender: TObject;Button: TMouseButton; Shift: TShiftState; X, Y: Integer);varIndex: Integer;begin//左键点击并且双击if (Button = mbLeft) and (ssDouble in Shift) thenbeginIndex := PageControl1.IndexOfTabAt(X, Y);if Ind
阅读全文
DBGridEh合计
摘要:dbgrideh1.footerrowcount:=1;dbgrideh1.sumlist.active:=true;每一列pDbGrid.Columns[0].Footer.ValueType:=fvtStaticText; pDbGrid.Columns[0].Footer.Value:='记录数'; pDbGrid.Columns[1].Footer.ValueType:=fvtCount;dbgrideh,displayformat #,###0.00
阅读全文
dbadvgrid合计和添加序列号
摘要:gslb1.AutoNumberCol(0); //第0列设置为序号列gslb1.FloatingFooter.ColumnCalc[0] := acCount; //第一列统计为计数gslb1.FloatingFooter.ColumnCalc[7] := acSum; //第二列统计为求和gslb1.FloatingFooter.ColumnCalc[8] := acSum; //第二列统计为求和
阅读全文
DBGridEh添加序号列
摘要://聲明全局變量i procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin with DBGrid1.DataSource.DataSet do begin if DataCol = 0 then //設置在第一列 begin if state<>dsInsert then i:= recno; //這句是關鍵。。。 DBGrid1.Canvas.TextRec
阅读全文
Delphi 日期格式固定
摘要:Delphi 日期格式问题我用strtodate('2001-12-30') 出现'is not a valid date '错误我查看 控制面板->区域设置->日期发现日期 分隔符号用了 '/' 如果改为'-'就没有问题解决办法:在主程序的OnCreate事件中加入: DateSeparator := '-'; ShortDateFormat := 'yyyy-mm-dd'; LongDateFormat := 'yyyy-mm-dd';
阅读全文
浙公网安备 33010602011771号