摘要:
有问题
//ListBox选中的项目移动到第1位 Listbox1.Items.Move(ListBox1.ItemIndex,0); //ListView选中的项目移动到第1位 procedure TForm1.Button5Click(Sender: TObject);varsel:String;beginwith ListView... 阅读全文
摘要:
ListView返回选中的多项目 procedure TForm1.Button3Click(Sender: TObject);vars: string;I: Integer;beginfor i := 0 to listview1.items.count - 1 dobeginif listview1.items[i].selected then... 阅读全文
摘要:
unitUnit1; interface uses Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms, Dialogs,ComCtrls,StdCtrls; type TForm1=class(TForm) ListView1:TListView; ... 阅读全文
摘要:
为TListBox添加水平滚动条
实例说明
TListBox组件是一个较为常用的列表组件,在默认情况下该组件是没有水平滚动条的,所以文字过长会显示不完全,在文字较短的情况下还可以,但是如果一行的文字很长的话也不行。本例为TListBox添加了一个水平的滚动条,运行本程序单击【添加滚动条】按钮在TListBox组件中就会增加一个水平滚动条,运行效果如图1所示。 图1 为TListBox... 阅读全文
摘要:
ComboBox1.Perform(CB_SETDROPPEDWIDTH, 200, 0); 下拉高度
ComboBox1.DropDownCount:=20; {$externalsym cb_geteditsel}cb_geteditsel= $0140;{$externalsym cb_limittext... 阅读全文
摘要:
//返回ListBox选中的多项目 procedure TForm1.Button2Click(Sender: TObject);vari:Integer;s:string;beginfor i:=0 to ListBox1.Items.Count-1 doif ListBox1.Selected[i] thens:=s+ListBox1.Items[i]+#... 阅读全文
摘要:
//动态创建组件TEditprocedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);varEdit:TEdit;beginEdit:=Tedit.Create(nil);Edit.parent :=Self;Edit.Show... 阅读全文
摘要:
//限制字符的输入{ 只能输入以下字符 }procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin If (Key in ['\', '/', ':', '*', '?', '', '|']) then Key := #0; If not(Key in ['0' .. '9', 'a' .. 'z', 'A... 阅读全文
摘要:
停留在窗体下面 处于
force my form to stay on the bottom?unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs;typeTForm1 = class(TForm)private... 阅读全文
摘要:
VCL BitMap Style Proceject Options->Application->Appearance
选择几个样式
使用代码设置 uses Vcl.Themes;procedure TForm1.Button1Click(Sender: TObject);beginTStyleManager.TrySetStyle('Amakrits');end; ... 阅读全文
摘要:
delphi 判断是否出现滚动条 if (GetWindowlong(Stringgrid1.Handle, GWL_STYLE) and WS_VSCROLL) 0 then ShowMessage('Vertical scrollbar is visible!'); if (GetWindowlong(Stringgrid1.Handle, GWL_STYLE) ... 阅读全文
摘要:
在运行时移动控件 procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);constSC_DragMove = $F012;beginBeginReleaseCapture;Button1.pe... 阅读全文
摘要:
//function GetUser: string; //获取本机当前用户名varBuffer: array[0..255] of Char;Size: cardinal;beginSize := 256;if GetUserName(Buffer, Size) thenbeginResult := BufferendelsebeginResul... 阅读全文
摘要:
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ShellAPI;type TForm1 = class(TForm) Memo1: TMemo; procedure FormCreate(S... 阅读全文
摘要:
(*功能:IniFormState1 保存和读取 窗体的大小2 保存和读取 窗体在屏幕上的位置//让程序第1次出现在屏幕的中心点获取屏幕的中心点POSITION:poScreenCenter //不行*)//implementation//{$R *.dfm}uses IniFiles;//引用IniFiles///写入信息到ini文件 procedureWriteformStat... 阅读全文