¿ìËÙÒµÎñͨµÀ

TForm³£Óü¼ÇÉ

×÷Õß ØýÃû¼¼Êõ À´Ô´ ³ÌÐòÉè¼Æ ä¯ÀÀ ·¢²¼Ê±¼ä 2012-06-30

Ò»¡¢Èô°¿Ú×ÜÊÇÔÚ×îÇ°Ãæ

Form µÄFormStyleÊôÐÔÉèÖÃΪfsStayOnTopÖµ¡£

¶þ¡¢ ¶¯Ì¬µ÷Óô°ÌåForm

ÔÚȱʡÇé¿öÏ£¬ ÓÉFile/New FormÉú³ÉÌí¼ÓÈëÏîÄ¿ÎļþÖÐµÄ ´°Ì嶼¾ßÓÐ"Auto Create"£¨×Ô¶¯´´½¨£©µÄÌØÐÔ¡£¼´Ö»Òª³ÌÐòÔËÐУ¬¸Ã´°Ìå¾Í´æÔÚÓÚ ÄÚ´æÖÐÁË£¬²»¹Üµ±Ç°ËüÊÇ·ñ±»µ÷Ó᣾ßÓÐÕâÖÖÌØÐԵĴ°ÌåÒ»°ãÊÊÓÃÓÚ´°ÌåÊôÐÔ±È½Ï ¹Ì¶¨¡¢¾­³£±»µ÷ÓõÄÇé¿ö¡£ÆäÓŵãÊÇËٶȿ죬ȱµãÊÇÕ¼ÓÃÄÚ´æ¡£ÔÚʵ¼Ê³ÌÐòÉè ¼ÆÖУ¬»áÓö¼û´óÁ¿ÀàËƶԻ°¿ò¹¦ÄܵĴ°Ì壬ËüÃÇÓÃÓÚÏÔʾ״̬»òÊäÈëÐÅÏ¢£¬½öÐëÔÚ³Ì ÐòÖе÷ÓÃһϣ¬Íê³ÉÆ书ÄܾÍÐÐÁË£¬ÎÞÐ***פÄÚ´æ¡£Õâʱ¿ÉÒÔͨ¹ýÑ¡ÔñProject/Options/Forms£¬½«"Auto--Create forms " À¸ÖÐÏàÓ¦µÄ´°Ìå, ÈçForm1£¬ÓÃ" >" ¼üÒƶ¯µ½ "Available forms"À¸ÖУ¬²¢ÔÚ³ÌÐòÐèµ÷Óøô°Ìå´¦£¬¼ÓÈëÏÂÁÐÓï¾ä£º

TForm1¡¡*myform=new TForm1(this);

myform- >ShowModal();

delete myform;

´°ÌåForm1½öÊÇÔÚÐèÒªµ÷ ÓÃʱ²Åµ÷ÈëÄڴ棬µ÷ÓÃÍê³Éºó£¬¼´ÓÃdeleteÇå³ý³öÄÚ´æ¡£ÕâÑù¿É¼õÉÙ³ÌÐò¶ÔÄÚ´æ×ÊÔ´ µÄÕ¼Óá£

Èý¡¢±éÀú´°Ìå¿Ø¼þµÄ·½·¨

Òª·ÃÎÊ»òÐ޸Ĵ°ÌåÉϵĿؼþ£¬·½·¨ºÜ¼òµ¥£¬ÒÔTEditΪÀý×Ó£º

Edit1- >Text="";

Edit2- >Text="";

µ«Èç¹û´°ÌåÉÏÓÐÊ®À´¸öÏñEdit1 ÕâÑùµÄ¿Ø¼þ£¬ÐèÒª½øÐÐÏàͬµÄ³õʼ»¯£¬ÓÃÉÏÃæµÄ·½·¨Ò»¸öÒ»¸öµØ½øÐУ¬Æñ²»Âé·³ £¡ ËùÒÔÓбØÒªÕÆÎÕ ±é Àú´° Ìå ¿Ø ¼þ µÄ ·½ ·¨¡£ ÔÚ ½é ÉÜ ¸Ã ·½ ·¨ Ö®¡¡ Ç°£¬ Èà ÎÒ ÃÇ ÏÈÁË ½â Ò» Ï ´° ÌåForm µÄComponents ºÍControls Êô ÐÔ¡£ ²Î ¼û ±í Ò»¡£

±í Ò»

ÊôÐÔ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ÀàÐÍ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ËµÃ÷
¡¡ ComponentCount¡¡¡¡¡¡¡¡¡¡¡¡Int¡¡¡¡¡¡Ä¿Ç°FormÉϸ÷Àà¿Ø¼þµÄ×ÜÊý
¡¡¡¡ Components¡¡¡¡¡¡¡¡¡¡ TCompont*¡¡ Ä¿Ç°FormÉÏÖ¸ÏòËùÓпؼþµÄÊý×é
¡¡  ControlCount¡¡¡¡¡¡¡¡¡¡¡¡ Int¡¡¡¡¡¡Ä¿Ç°FormÉÏijһ×ÓÇøÓòÉϸ÷Àà¿Ø¼þµÄ×ÜÊý
¡¡¡¡  Controls¡¡¡¡¡¡¡¡¡¡¡¡TControl*¡¡ Ä¿Ç°FormÉÏÖ¸Ïòijһ×ÓÇøÓòÉÏËùÓпؼþµÄÊý×é
 
¡¡¡¡¡¡ Form1µÄComponentCount=6, ¶øPanel1µÄControlCount=4.£¬
¡¡¡¡¡¡ ÆäÖУºÊý×é¶ÔÏó
¡¡¡¡ Components[0]¡¡¡¡¡¡¡¡¡¡ Panel1
¡¡¡¡ Components[1]¡¡¡¡¡¡¡¡¡¡ Label1
¡¡¡¡ Components[2]¡¡¡¡¡¡¡¡¡¡ Edit1
¡¡¡¡ Components[3]¡¡¡¡¡¡¡¡¡¡ Label2
¡¡¡¡ Components[4]¡¡¡¡¡¡¡¡¡¡ Edit2
¡¡¡¡ Components[5]¡¡¡¡¡¡¡¡¡¡ Button1
¡¡¡¡  Êý ×é¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶Ô Ïó
¡¡ Controls[0]¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ Label1
¡¡ Controls[1]¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ Edit1
¡¡ Controls[2]¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ Label2
¡¡ Controls[3]¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ Edit2

ÏÂÃæÕâ¶Î´úÂëÍê³ÉÁ˶ÔPanel1ÉÏËùÓÐTEdit ¿Ø¼þµÄ±éÀú³õʼ»¯¡£¶ÁÕßÉÔ¼ÓÐ޸ģ¬¼´¿É¶ÔÆäËü¿Ø¼þ½øÐбéÀú¡£ÕâÀïÓÐÒ»¸öС¼¼ÇÉ£¬ ÎÒÃÇ°ÑÐèÒª½øÐгõʼ»¯µÄ¿Ø¼þ·ÅÖÃÔÚÁËÒ»Panel1ÉÏ£¬Óë²»ÐèÒª³õʼ»¯µÄ¿Ø¼þÇø·Ö¿ª À´£¬ÕâÑù±ãÓÚ±à³Ì¡£

¡¡ AnsiString namestring="TEdit";
¡¡  for(int i=1;i< Panel1- > ControlCount;i++)
¡¡¡¡  {
¡¡¡¡  if(Panel1- > Controls[i]- > ClassNameIs(namestring))
¡¡¡¡¡¡  {
¡¡¡¡¡¡  TEdit *p=dynamic_cast < TEdit* > (Panel1- >Controls[i]);
¡¡¡¡¡¡  P->Text="";
¡¡¡¡¡¡  }
¡¡¡¡  }
 

ËÄ¡¢²»¹æÔò´°¿Ú

1.ÔÚ´°¿Ú¶¨ÒåÖÐ,¼ÓÈëHRGN hWndRgn;

2.ÔÚTForm::OnCreate()ÏûÏ¢º¯Êý×îºó,¼ÓÈëÏÂÃæµÄ´úÂë:

hWndRgn=::CreateEllipticRgn(0,0,Width,Height);

::SetWindowRgn(hWndRgn,TRUE);

3.ÉèÖÃTFormµÄÊôÐÔΪÎÞ±êÌ⣬Îޱ߿ò¡£

4.±àÒëÁ¬½ÓÓ¦ÓóÌÐò,¾Í¿ÉÒÔ¿´µ½Ò»¸öÍÖÔ²Ðδ°¿Ú¡£

Îå¡¢MDI Form

1.Application->CreateForm(__classid(Tjjcginput), &jjcginput);

ºó²»ÓÃÔÚʹÓÃÏÔʾFormµÄÓï¾ä¾Í¿ÉÒÔÏÔʾ³öÀ´ÁË¡£

2.form µÄonclose ʼþ±ØÐëÓÃÏÂÃæÓï¾äÊͷſռ䣺

void __fastcall TMDIChild::FormClose(TObject *Sender, TCloseAction &Action)
¡¡¡¡¡¡ {
¡¡¡¡¡¡¡¡ Action = caFree;
¡¡¡¡¡¡  }

ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!

·ÖÏíµ½£º ¸ü¶à

Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ