컴포넌트 만들기가 쉬운것 만은 아니군요...
컴포넌트 내부에 다음과 같은 함수를 만들어서 컴포넌트가 포함한 TPanel이나
Ttabsheet등의 container control이 가지고 있는 control 갯수를 확인할 수
있는 방법이 없을까요..??
아래와 같이 코딩하니깐...... controlcount를 정상적으로 가지고 못 오는것
같은데...
좀 도와 주세요..
function TDbSEdit.IsExistNullFieldInContainer: Boolean;
var
ParentComp: Tcomponent;
i,j: integer;
Begin
ParentComp := GetParentComponent;
j := 0;
with ParentComp do
for i:=0 to ComponentCount - 1 do Begin
if (components[i] is TdbSedit) then j := j + 1;
end;
showmessage('Tdbsedit가 모두'+inttostr(j)+'개 있습니다');
result := True
end;
로 고쳐서 해보세요...
장담은 못합니다... ^^;
왕초보 wrote:
> 컴포넌트 만들기가 쉬운것 만은 아니군요...
> 컴포넌트 내부에 다음과 같은 함수를 만들어서 컴포넌트가 포함한 TPanel이나
> Ttabsheet등의 container control이 가지고 있는 control 갯수를 확인할 수
> 있는 방법이 없을까요..??
> 아래와 같이 코딩하니깐...... controlcount를 정상적으로 가지고 못 오는것
> 같은데...
> 좀 도와 주세요..
>
> function TDbSEdit.IsExistNullFieldInContainer: Boolean;
> var
> ParentComp: Tcomponent;
> i,j: integer;
> Begin
> ParentComp := GetParentComponent;
> j := 0;
> with ParentComp do
> for i:=0 to ComponentCount - 1 do Begin
> if (components[i] is TdbSedit) then j := j + 1;
> end;
> showmessage('Tdbsedit가 모두'+inttostr(j)+'개 있습니다');
> result := True
> end;
>