  | 
				VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.   
				 | 
			 
		 
		 
	
		| 上一篇主題 :: 下一篇主題   | 
	 
	
	
		| 發表人 | 
		內容 | 
	 
	
		211482
 
 
  註冊時間: 2003-07-15 文章: 53
 
  第 16 樓
  | 
		
			
				 發表於: 星期二 九月 24, 2013 11:07 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				| 試試這個範例 | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		jerryclt
 
 
  註冊時間: 2009-03-10 文章: 334 來自: 佛心來的
  第 17 樓
  | 
		
			
				 發表於: 星期三 九月 25, 2013 6:49 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				BINGO !!
 
 
大致上就是要達到這樣的效果...
 
只是不大理解為什麼會這樣?
 
尤其是在未加上
 
IF !WEXIST('stest')
 
  DO FORM stest
 
ENDIF
 
的情形下會持續開啟一堆stest出來,
 
不會造成衝突嗎? | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		saint
 
 
  註冊時間: 2003-07-14 文章: 211
 
  第 18 樓
  | 
		
			
				 發表於: 星期四 九月 26, 2013 8:34 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				試試看個是否是你要的
 
SET procedure TO exec2form
 
test = CREATEOBJECT("exec2form")
 
 
在form2上 click 會把叫另一個form 出來
 
 
 	  | 代碼: | 	 		  
 
DEFINE CLASS exec2form as Custom
 
   form1 = .f.
 
   form2 = .f.
 
   formCollect = .f.
 
   procedure init
 
      with this
 
         .form1 = createobject("demoForm","form1",this)
 
         .form2 = createobject("demoForm","form2",this)
 
         .form2.visible = .t.
 
         .formCollect = createobject("collection")
 
         .formCollect.add(.form1)
 
         .formCollect.add(.form2)
 
      endwith
 
   endproc
 
   procedure activateform
 
      lparameter p_formCaption
 
      local frm as Form
 
      for each frm in this.formcollect
 
         if frm.Caption <> p_formCaption then
 
            frm.Show
 
         endif         
 
      next
 
   endproc
 
enddefi
 
 
DEFINE CLASS demoForm as Form
 
   main = .f.
 
   procedure init
 
      lparameter p_caption,po_main
 
      this.Caption = p_caption
 
      this.main = po_main
 
   endproc
 
   procedure click
 
      this.main.activateform(this.Caption)
 
   endproc
 
ENDDEFINE
 
 
 
 | 	 
  | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
  	 
	    
  	   | 
 	
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
  | 
   
  
		 |