¨D±Ð¦³ÃöUserForm¨Ï¥Î§¹«á¤£¦û°O¾ÐÅ骺²M°£¤èªk
- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 1# clio
Ó¤Hı±o unload ¬O¼g¦b form events(¦pclick) ¤ºnÃö³¬¡BÄÀ©ñ¦Û¤v³oÓªí³æ¥Îªº¡C
¦Ó¤£¬O¹³§A¼g¦b show ¤U±¡A§A³o¼Ë¼g¥i¯à·|¦³¤£¨}®ÄªG¡C
¨Ò¦p§Aªº¤èªk¤G¡A
¦pªG¦b UserForm_Initialize() ¥[¤@¦æ MsgBox "Hi"¡A§A²q¥¦·|³Q©I¥s´X¦¸?
µª®×¬O¨â¦¸!!
²Ä¤@¦¸¬Oµo¥Í¦b UserForm1.Show¡A¦]¬°«e±¨S©ú½T¼g¥X Load (³o¬O¤¹³\ªº)¡AVBA¦Û°ÊÀ°§Aload«Ø¥ßForm¡C
µM«á¦]¬°§A«öªí³æªº x Ãö³¬®É¡AUserForm1¤w¸gÄÀ©ñ±¼¤F¡A©Ò¥H·í§A°õ¦æ¨ì Unload UserForm1 ¡AVBA¤S¦Û°ÊÀ°§A«Ø¥ßForm¡A¦AÄÀ©ñ±¼¡C
¦Ó¤èªk¤@¡A¬O§â UserForm1·íª«¥óÃþ§O¥Î
§Úı±o§a¡A set ... = new ...¡A´N¬O¨ú¥N Load §@¥Î¡AUnload AForm§Ú¬O¤£ª¾¹D¦³¨S¦³®ÄªG¡C
ª«¥óªº°O¾ÐÅ餣¥Î¤ÓªÈµ²¡A¦L¶H¤¤ VBA À³¸Ó¬O±Ä¥Î garbage collector ¾÷¨î¡Apºâ¤Þ¥Î¦¸¼Æ (reference count)¡A·í¤Þ¥Î¦¸¼Æ¬°¹s´N·|§ä®É¾÷¦^¦¬°O¾ÐÅé¤F¡C
¬JµMAForm¬O°Ï°ìÅܼơAÂ÷¶}¨ºÓSub ´NÄÀ©ñ¤F(¤]´N¬O¤£¤Þ¥Î¤F)¡A³o¸Ì¬Æ¦Ü¥[¤£¥[Set AForm = Nothing³£µL©Ò¿×¡C
§Úªº¸Ü¡An¹À«ö¶s¤º°µ§¹¤@¨Ç¨Æª½±µ unload meÃö³¬µøµ¡¡An¹À´N³£¤£¥[ unload¡A¤â°Ê«öXÃö³¬µøµ¡¡C
¦³¿ù½Ð«ü¥¿³á~ |
|
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C
|
|
|
|
|