ICode9

精准搜索请尝试: 精确搜索
  • Delphi 新语法:泛型2022-09-14 12:05:16

      这里的新语法一般指Delphi7不支持的语法,高版本中会经常遇到,所以花一点时间学会使用它。泛型是一种特殊的类型。你不用一开始就指明参数的具体类型,而是先定义一个类型变量,在使用的时候再确定参数的具体类型。准备从万一博客中学习,节约翻找资料的时间。 最简单的泛型 一开始我们

  • 02-mORMot框架样例学习-02 - Embedded SQLite3 ORM(SQLite3 数据库)2022-09-04 19:04:48

      program Project01; uses {$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads Forms, SysUtils, SynCommons, mORMot, Unit1 in 'Unit1.pas' {Form1} ,mORMotSQLite3, SynSQLite3Static ; {$R *.res} begin App

  • [转]lazarus中不支持匿名方法的解决方案2022-08-12 14:30:09

    lazarus目前不支持匿名方法,在不继承线程的情况下,使用匿名线程或TThread.ExecuteInThread时,需要单独写两个方法:一个给TThread.ExecuteInThread用,另一个给同步用。感觉比较麻烦,并且可读性略差。 经过测试,下面代码的解决方案感觉好一些。 unit Unit1; {$mode objfpc}{$H+} interfa

  • 关于 Delphi 中流的使用(1) 用 TMemoryStream(内存流) 入门2022-07-04 13:05:32

    前言:所谓"流", 就是一段数据或是一块内存;在进行流操作时, 我们不必关心流中的数据到底是什么; 只需要知道流的大小和当前的指针位置. 所以流只有两个属性:Size、Position.对流的操作, 不过就是读取和写入. 所以流最主要的方法就是 Read 和 Write.在很多控件的使用中, 读取主要用

  • delphi @ 与 ^ 运算符2022-05-19 22:31:25

    @ 与 ^ 运算符//例1:procedure TForm1.Button1Click(Sender: TObject);varstr: string;p: Pointer;beginp := @str; //变量 str 的地址p := @Form1; //变量 Form1 的地址p := @TForm1.Button1Click; //过程 TForm1.Button1Click 的地址p := Addr(str); //同 p := @str;ShowMessage(

  • 获取点击的控件名称2022-03-06 09:31:06

    1.对于有句柄的控件,可以用一下代码interface    uses    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,    Dialogs, StdCtrls, ComCtrls;    type    TForm1 = class(TForm)      btn1: TButton;    

  • Passcal运费计算2022-01-10 16:04:48

    unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; txtweight: TEdit; txtdistence:

  • C++ Builder之StringGrid表格简单示例(TStringGrid控件实例例子)2022-01-07 07:31:45

    程序运行截图如下: 每次点击可以生成不同的成绩表。 主要源代码如下: //--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit1.h" //-------------------------------------------------------------

  • 创建和调用DLL的Delphi代码2021-12-31 09:37:49

    Dll里中的代码 library RegDll; uses SysUtils, Classes, Windows, Registry; // 没 Windows 注册表里查找不到 HKEY_LOCAL_MACHIN Registry为注册表操作 {$R *.res} Function 函数名 (变量: String):String; StdCall; // 注册表查询获得AE软件所有版本返回字符串列表 beg

  • DELPHI 调用SAP—RFC 示例2021-12-27 16:04:26

    DELPHI 调用SAP—RFC 示例 Logon to the R3-system with the componente TSAPLogOnControl In this example the form TForm1 contains the following components: Component FunctionSAPLogOnControl1 SAP ActiveX-Component to logon to the systemButton1 Button to start the

  • 修改delphi 窗体名称2021-08-01 01:02:31

    默认的情况下,IDE帮我们建立的窗体类都如下:   type TForm1 = class(TForm) ScrollBox1: TScrollBox; GroupBox1: TGroupBox; ScrollBox2: TScrollBox; RadioGroup1: TRadioGroup; private { Private declarations } public { Public declarations

  • Delphi两个取字串长度的函数strlen,length2021-07-22 09:04:07

    相关资料: http://www.delphitop.com/html/zifuchuan/1242.html   【strlen】PChar 串专用函数:串长度procedure TForm1.BitBtn1Click(Sender: TObject); var s: Widestring; begin s := '桂枝香在故国晚秋'; ShowMessage(IntToStr(Length(String(s))));//结果不是8而是16 end;━━

  • cxGrid 锁定一行,让该行数据不能编辑2021-07-15 17:33:14

    在使用cxGrid时,由于设置了所有单元格都能编辑, 但在特定的情况下,让某些行,根据一些列值条件,让该行整行锁定,不能编辑。 研究了很久,在DevExpress官网上找到了相关的资料,因此,分享给大家。 Dev官网的列子是这样的 // DISABLE A ROW  整行禁止编辑 procedure TForm1.cxGrid1DBTableV

  • C++ Builder关于Application之ProcessMessages方法和Terminated属性——在循环中刷新界面显示、响应点击、关闭程序等2021-06-26 12:35:26

    先看一个例子和程序截图: 源代码如下: Unit1.h文件 //--------------------------------------------------------------------------- #ifndef Unit1H #define Unit1H //--------------------------------------------------------------------------- #include <Classes.hpp> #i

  • 图片的居中、拉伸与平铺 - 回复 "我是一只想飞的小小鸟" 的问题2021-06-06 22:08:19

    图片的居中、拉伸与平铺 - 回复 "我是一只想飞的小小鸟" 的问题 问题来源: http://www.cnblogs.com/del/archive/2008/11/04/1326105.html#1533947 本例效果图: 代码文件:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Control

  • Yesterday、Today、Tomorrow - 昨天、今天、明天2021-06-06 22:08:00

    Yesterday、Today、Tomorrow - 昨天、今天、明天 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end; var Form1

  • 如何在数据表中存取图片 - 回复 "三足乌" 的问题2021-06-06 22:06:40

    如何在数据表中存取图片 - 回复 "三足乌" 的问题 问题来源: http://www.cnblogs.com/del/archive/2009/05/28/1491186.html#1801853 准备工作: 1、在空白窗体上添加: ClientDataSet1、Button1 2、激活窗体的 OnCreate 事件、激活 Button1 的 OnClick 事件 实现代码:unit U

  • 唤醒控件曾经拥有的能力2021-06-06 22:06:21

    唤醒控件曾经拥有的能力 控件的祖先 TControl 有很多功能, 但它的有些子孙确丧失了很多(为了专用). 譬如 TBevel 就没有把一些常规的事件继承下来, 那些没有被继承的功能一般都隐藏在 protected 区, 如果重新继承是可以使用的. 这里尝试了另外一种方法: 自己没有继承时,

  • 字符串转换到指定格式的宽字符 - 回复2021-05-30 15:51:56

    本例效果图:代码文件:unit Unit1; interface uses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,   Dialogs, StdCtrls; type   TForm1 = class(TForm)     Memo1: TMemo;     Button1: TButton;     Edit1:

  • Delphi 7拦截滚轮事件不响应滚轮的上下滚动2021-05-27 20:04:25

    unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Panel1: TPanel; ComboBox1: TComboBox; Label1: TLabel; procedure FormCreate(Sender:

  • Delphi 7中如何修改Form1: TForm1;2021-05-27 20:01:36

    Delphi 7中如何修改Form1: TForm1;  1]选中对应的Form, 2]在Object Inspector里的Name修改, 3]回车,即可.Delphi的IDE对应做了以下五处修改: {===================在.dpr===================}program Project1;uses   Forms,   Unit1 in 'Unit1.pas' {DFGSDGF};//Unit1

  • 关于禁止程序重复启动的另一种需要与实现2021-05-20 18:07:11

    关于禁止程序重复启动的另一种需要与实现 手头的程序需要禁止重复启动, 但需要保留新的、关闭旧的. 我想还是从主窗口的类名下手吧; 写了一个函数, 在 OnCreate 中调用即可:{ 函数 } procedure CloseSameClassNameWindow(ACurrentWindow: HWND; const AClassName: string);

  • 如何在 TDrawGrid 的单元格中显示图片 - 回复 "巅枫" 的问题2021-05-20 18:03:31

    如何在 TDrawGrid 的单元格中显示图片 - 回复 "巅枫" 的问题 问题来源: http://www.cnblogs.com/del/archive/2008/03/06/1094289.html#2023057在 C:\Temp\ 下准备 1.bmp、2.bmp、3.bmp 三个图片, 然后:unit Unit1; interface uses Windows, Messages, SysUtils, Variant

  • 给定 ComboBox 的默认值2021-05-10 17:34:24

    unit Unit1; interfaceuses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, StdCtrls; type   TForm1 = class(TForm)    ComboBox1: TComboBox;    Button1: TButton;    Button2: TButton;    procedure FormCreate(Se

  • Action 相关组件2021-05-01 07:08:14

       Action 相关组件    TAction //<- TCustomAction <- TContainedAction <- TBasicAction <- TComponent TActionList //<- TCustomActionList <- TComponent //其父类 TCustomActionList 包含一个 TContainedAction 类型的动作列表(Actions[]) TActionMan

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有