로딩
요청 처리 중입니다...

[Delphi] SetBounds

 [Delphi] SetBounds

SetBounds() : 컨트롤의 크기와 위치를 수정할 때 사용합니다. 델파이에서 컨트롤의 크기나 위치를 조절할때(SetWidth, SetHeight, SetTop, SetLeft 등), SetBounds를 호출하는데, 만약 해당 컨트롤을 위치나 크기를 수정할경우, 주로 아래 방식으로 많이 진행하는데, with TLabel.Create(Self) do begin Left := 100; Top := 150; Width := 200; Height := 400; end; 위와 같이 사용할경우, SetBounds를 여러번 호출하기 때문에, 여러번 화면갱신을 진행하게 됨.

즉 SetBounds를 사용하여 한번에 처리하는게 좋다고 함. // 구성 procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); virtual; // 예제 with TLabel.Create(Self) do begin SetBoudns(100, 150, 200, 400); ...

원문 링크 : [Delphi] SetBounds