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
[38274] 폼 동적생성!!!
이성제 [14dia] 947 읽음    2004-12-04 17:45
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
TForm *f;
TLabel *l;
TButton *b;
int ct=0;
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    Timer1->Interval=100;
    ct=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button(TObject *Sender)
{
    f->Tile();
    f->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
    f=new TForm(this);
    l=new TLabel(this);
    b=new TButton(this);
    f->Top=random(800);
    f->Left=random(1000);
    f->Width=169;
    f->Height=128;
    f->Caption=IntToStr(ct);
    l->Caption="사랑해♡";
    l->Width=57;
    l->Left=16;
    l->Height=13;
    l->Top=24;
    l->Parent=f;
    b->Caption="확인";
    b->Parent=f;
    b->Left=48;
    b->Top=56;
    b->Left=48;
    b->OnClick=Button;
    f->Show();
    ct++;
    if (ct == 100)
    {
        Timer1->Interval=0;
    }
}
//---------------------------------------------------------------------------
























//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE-managed Components
    TButton *Button1;
    TLabel *Label1;
    TTimer *Timer1;
    void __fastcall Button1Click(TObject *Sender);
    void __fastcall Timer1Timer(TObject *Sender);
private:    // User declarations
public:        // User declarations
    __fastcall TForm1(TComponent* Owner);
    void __fastcall Button(TObject *Sender);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif



















어떻게 하면 동적 생성된 100개의 폼중에

버튼을 누른 해당 폼을 죽일수 있을까요??

잘 안되네요

무슨 컴포넌트가 특별히 있는것도 아닌거 같은데

빠른 답변 부탁드립니다.ㅠㅠㅠ

+ -

관련 글 리스트
38274 폼 동적생성!!! 이성제 947 2004/12/04
38287     Re:폼 동적생성!!! 푸른하늘 1013 2004/12/06
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.