C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[73867] MDI Child 폼 생성시 깜박거리지 않게 하려면 어떻게 해야 할까요?
초난감 [iamcydonia] 3616 읽음    2016-09-27 21:58
안녕하세요.

제목과 같은 구현이 필요해서 구글링 해보니

To create MDI child forms invisible you set their Visible property to False, and in addition you have to disable the VCL behaviour of force-showing them during creation. This happens by the FormStyle property setter of TCustomForm, which sets Visible to True for MDI child forms.

If you set the FormStyle in the object inspector, then the property setter will be called during form creation already, and the form will not be shown immediately, but only after the construction is complete. This allows you to reset the request to show the form, by overriding the AfterConstruction() method like so:

procedure TMDIChild.AfterConstruction;
begin
  Exclude(FFormState, fsVisible);
  inherited;
end;
This will create an invisible MDI child form.

To test this you can create a new MDI application in the IDE, override the method in the child form class like shown above, and simulate a long initialization:

procedure TMainForm.FileNew1Execute(Sender: TObject);
var
  i: integer;
begin
  for i := 1 to 10 do begin
    CreateMDIChild('NONAME' + IntToStr(MDIChildCount + 1));
    Update;
    Sleep(500);
  end;
  for i := 0 to MDIChildCount - 1 do
    MDIChildren[i].Visible := True;
end;
Without the overridden AfterConstruction() method it will create and show a MDI child every half second. With the overridden method it will show them all after a busy period of 5 seconds, which will give you the chance to show your splash screen instead.

이렇게 되어 있는데 제 실력으로는 어떻게 해야 할 지 몰라서요... (CBuilder로는 어떻게 해야 하는지요? ㅠ,ㅠ)

많은 조언 부탁 드립니다.

+ -

관련 글 리스트
73867 MDI Child 폼 생성시 깜박거리지 않게 하려면 어떻게 해야 할까요? 초난감 3616 2016/09/27
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.