Delphi
2022-11-21
144
Delphi 之 工具栏组件(TToolBar) 工具栏组件(TToolBar)为用户提供了快捷菜单的访问方式。 Buttions 列出工具栏中的工具按钮,其中保存了TToolButton实例的列表 Canvas在OnCustomDraw或OnCustomDrawItem事件中使用该属性可以在工具栏上画图。 Constraints规定TToolBar的大小限制 Customizable设置该属性为True,允许用户在程序运行时添加、删除和移动工具栏按钮。用户可以按Shift键拖动按钮到一个新的
2022-11-21
77
TTimer组件属性 Enabled属性 该属性控制TTimer组件是否周期性的产生OnTimer事件,为True,则产生周期性事件。false则不产生示例procedure TForm1.FormCreate(Sender: TObject);begin timer1.Enabled:= False; Timer2.Enabled:= False;end;procedure TForm1.Timer1Timer(Sender: TObject);begin Edit1.Text:= IntT
2022-11-21
82
示例 delphi listbox用Canvas属性绘图procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);var i:integer;begin with Control as TListBox do begin Canvas.FrameRect(Clientrect); if odSelected in State
2022-11-21
40
示例:delphi listbox自动获取列表框中的组件焦点procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);var i:Integer;begin for i:= 1 to Length(Trim(Edit1.text))do SendMessage(ListBox1.Handle,WM_CHAR,Integer(Edit1.Text[i]),0); SendMessage(L
2022-11-21
133
TListBox组件属性AutoComplete 设置是否将焦点移到用户键盘输入选项上BorderStyle 设置组件是否有边框Canvas 提供一个绘图面板。Columns 指定列表框的可见列数Count 获得列表框的组件选项数ExtendedSelect 是否可以在列表框中选取一个范围的选项IntegralHeight 设置列表框是否部分显示那些显示不全的选项ItemHeight 设置列表框的高度Items 设置列表框的所有选项MultiSelect 是否使用多项选择功能Scro
2022-11-21
52
delphi listbox模糊查找文字procedure TForm1.Edit1Change(Sender: TObject);var LIndex:Integer; // begin LIndex:=SendMessage(ListBox1.Handle,LB_SELECTSTRING,-1,LongInt(Edit1.Text));end;
2022-11-21
68
TBevel组件该组件可以创建具有3D效果的斜角的盒子、方框或线。常用属性: shape:设置边界形状 style:设置分解的框线在屏幕上是凸起还是凹下。 shape属性 type TBevelShape = (bsBox, bsFrame, bsTopLine, bsBottomLine, bsLeftLine, bsRightLine, bsSpacer); bsBox: 由style属性决定。 bsFrame:客户区域是凸起还是凹下。 bsTopLine:Bevel对象在客户区域显示
2022-11-21
100
看了下10.3.2版intToHex等,跟之前的xe版比较,去掉了汇编,我试了下,变慢了好多,自己写些了个,纯pascal版,测了下,要比自带的函数快差不多一倍,比xe汇编版也快很多做了点优化,大概计算时间是Delphi 10.3.2自带函数的三分之一计算时间function intToHexA(iValue: Cardinal; Digits: Integer): string;const hexChar: array[0..15] of char = '0123456789ABCDEF