1. TControl.ClientWidth与TControl.Width区别
TControl.Width := TControl.ClientWidth + borderWidth + ScrollbarWidth(竖着的哪个);
TControl.Width := TControl.ClientWidth + borderWidth + ScrollbarWidth(竖着的哪个);
如果一个控件的BorderStyle := bsNone(即BorderWidth:=0) 且 ScrollBars 没有竖着的哪个滚动条哪么 TControl.ClientWidth与TControl.Width相等
2.在很多時候設計界面的時候,部分控件需要顯示隱藏,或者需要反復設置它們的Enabel屬性.
procedure TFormClass.SetEditMode(Edits: array of Tcontrol; Flag: Boolean);
var i : integer;
begin
for i := Low(Edits) to High(Edits) do
Edits[i].Visible := Flag;//此為設置Visible屬性,也可以設置Enable屬性
end;
調用: