📄 myfunc.pas
字号:
unit MyFunc;
interface
uses ADOdb, dialogs, Windows, Sysutils, classes, stdctrls, Graphics,
comctrls, checklst, Forms, Menus;
procedure MakeAllEnabled(component: TComponent; b: Boolean);
implementation
procedure MakeAllEnabled(component: TComponent; b: Boolean);
var
i: Integer;
com: TComponent;
color: TColor;
begin
//窗口刚刚出现的时候,所有的控件不可用,只有当读取数据库的操作完成之后才可以使用
if b then
color := clWindow
else
color := clSilver;
for i:=0 to component.ComponentCount-1 do
begin
com := component.Components[i];
if com is TEdit then
begin
TEdit(com).Enabled := b;
//TEdit(com).Color := color;
end else if com is TMemo then
begin
TMemo(com).Enabled := b;
//TMemo(com).Color := color;
end else if com is TTreeView then
begin
TTreeView(com).Enabled := b;
//TTreeView(com).Color := color;
end else if com is TListBox then
begin
TListBox(com).Enabled := b;
//TListBox(com).Color := color;
end else if com is TCheckListBox then
begin
TCheckListBox(com).Enabled := b;
//TCheckListBox(com).Color := color;
end else if com is TButton then
begin
TButton(com).Enabled := b;
end else if com is TToolButton then
begin
TButton(com).Enabled := b;
end else if com is TCheckBox then
begin
TCheckBox(com).Enabled := b;
end else if com is TMenuItem then
begin
TMenuItem(com).Enabled := b;
end else if com is TScrollBox then
begin
TScrollBox(com).Enabled := b;
end else if com is TCustomListView then
begin
TCustomListView(com).Enabled := b;
end else if com is TLabel then
begin
if TLabel(com).name<>'Title' then
TLabel(com).Enabled := b;
end else if com is TComboBox then
begin
TComboBox(com).Enabled := b;
//TComboBox(com).Color := color;
end;
end;
end;
begin
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -