随笔分类 - Delphi
Delphi 相关技术文档
    
摘要:@:取址运算符; var int:integer; p:^integer; new(P); int:=24; p:=@int; dispose(P); ^:指针的引用解析操作符; var pint:^integer; new(pint); showmessage(inttohex(integer(@
        阅读全文
            
摘要:你把一个TButton和一个TSpeedButton的OnClick都设置成一样的试看看。如procedure TForm1.SpeedButton1Click(Sender: TObject);begin if TWinControl(Sender).Name = 'Button1 ' then ShowMessage( 'Button1 ') else if TWinControl(Sender).Name = 'SpeedButton1 ' then ShowMessage( 'SpeedButton1 ');end;===
        阅读全文
            
摘要:procedure TFrmSysIni.FormCreate(Sender: TObject);var I:Integer; Col,Row:Integer;//第几列begin TabelList:=TStringList.Create; DM1.ADOC1.GetTableNames(TabelList); Col:=0; Row:=0; For I:=0 to TabelList.Count-1 do begin if Col>13 then begin Col:=0; Row:=Row +1 ; end; CheckList:=TRzCheckBox.Create(Self);
        阅读全文
            
摘要:TListView 可以帮你实现。1. 在界面添加TListView 控件 ListView1,设置 ListView1.viewStype:=vsReport。或等于vsList。 ListView1.checkboxes:=True;2. 可以把数据加载到 ListView1中。 ListView1.Items.Clear; ListView1.Items.BeginUpdate; for i:=1 to 10 do begin vLvItem := lv1.Items.Add; vLvItem.Caption:='aa'+ IntToStr(i) ; vLvItem.Su
        阅读全文
            
摘要:1.把DBGRID的第一列更变内容显示 if Column.FieldName= 'OPERATORID' then if DataCol = 0 then begin DBGrid2.Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2, IntToStr(i)); inc(i); end;//I:显示了其顺序号。如:procedure TfrmDetail01.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: T
        阅读全文
            
摘要://添加数据和对象到下拉框procedure TForm1.Button1Click(Sender: TObject);var s:string;begin ComboBox1.Items.Clear; s:= '1001'; //ComboBox1.Items.Add('1'); ComboBox1.Items.AddObject('1',TObject(s) ); s:='2001'; //ComboBox1.Items.Add('2'); ComboBox1.Items.AddObject('2
        阅读全文
            
摘要:DBGrid中顯示行號的終極解決方案 昨天在大富翁論壇上見一貼子,求在DBGrid中顯示行號的方法,並稱此題為“曠世難題”,我一想,這樣的題目也叫曠世難題?於是自己就動手嚐試,結果發現原來並不簡單,確實是有點難度。後來又在網上搜索良久,也始終找不到一個很好的解決方案,有的也只是在瀏覽狀態下才能實現,而在Insert下卻不能實現,所有的行號都顯示為 -1。 難道?delphi真的是無能為力的嗎?我不信,幾經試驗,終於讓我找到了解決方法,代碼如下: //聲明全局變量i procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Re.
        阅读全文
            
摘要:在delphi Lib\目录下找到qrprev.dfm 文件,并在此文件中增加BorderIcons = [biSystemMenu, biMaximize] 如:C:\Program Files\Borland\Delphi5\lib\qrprev.dfm 中增加(红色部分) TextHeight = 13 BorderIcons = [biSystemMenu, biMaximize] object StatusBar: TStatusBar Left = 0 Top = 538 Width = 644 Height = 19
        阅读全文
            
摘要:Function Checkip(const Ip:String):byte;var i,k:Integer; s1:String;begin Result:=0; s1:=Ip; i:= Pos('.',s1); s1 := s1 + '.'; while i > 0 do begin if not Length(Copy(s1,1,i)) in [2..4] then break; k:=StrTointDef(Copy(s1,1,i-1),-1); if (k<0) or (k>255) then Break; inc(Result); 
        阅读全文
            
摘要:procedure TfrmMain.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);var aIndex:Integer; aDBGrid:TDBGrid;begin if Sender is TDBGrid then begin aDBGrid:=TDBGrid(Sender); if State=[] then with aDBGrid do begin if Assigned(DataSource) an
        阅读全文
            
摘要:// inherited 就是调用父类方法的一个特殊命令; 举例:
        阅读全文
            
摘要:1.cannot create form no MDI FORM ARE CURRENTLY ACTIVE//2012-4-18动态库窗体 指定为子窗体出错
        阅读全文
            
摘要:delphi 5 Project ->Options提示内存报错,界面打不开?解决:右键我的电脑-》属性-》高级-》性能-》数据执行保护-》只为关键。。。
        阅读全文
            
摘要:procedure hideTaskbar;var wndHandle : THandle; wndClass : array[0..50] of Char; //char数组保存任务栏类名begin //StrPCopy(@wndClass[0], 'Shell_TrayWnd'); wndHandle := FindWindow(PChar('Shell_TrayWnd'), nil); ShowWindow(wndHandle, SW_HIDE); //将nCmdShow设为SW_HIDE来隐藏窗口end;procedure showTaskbar;var
        阅读全文
            
摘要:StrPCopy 功能说明:将字符串复制到字符数组中。该函数有两个参数。第一个参数为“目标数组”,第二个参数为“字符串”。 参考实例: var arrChar: array[0..255] of Char; // 这里声明了长度为256的Char型数组 begin StrPCopy(arrChar, 'Come on, baby!'); end;
        阅读全文
            
摘要:delphi中临界操作方法2008-05-09 19:48var FLock:TRTLCriticalSection; //定义临界区域begin InitializeCriticalSection(FLock); //初始化临界区域 EnterCriticalSection(FLock); //进入临界区域 LeaveCriticalSection(FLock); //退出临界区域 DeleteCriticalSection(FLock);//删除临界区域end;//CLASS中使用实例TRegGroups = classprivate ............. FLock: TRTLCr
        阅读全文
            
摘要:Delphi错误:"External exception C0000235"与小红伞(Avira AnitVir)配置---来源:TTT BLOG [ http://www.taoyoyo.net/ttt/ ]地址:http://www.taoyoyo.net/ttt/post/513.html ---今天要修改一个程序,但原本正常的程序怎么也调试不过去了,总是报错如下:Porject XXX.exe raised exception class EExternalException with message "External exception C000023
        阅读全文
            
 
                    
                     
                    
                 
                    
                 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号