  | 
				VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.   
				 | 
			 
		 
		 
	
		| 上一篇主題 :: 下一篇主題   | 
	 
	
	
		| 發表人 | 
		內容 | 
	 
	
		Batman
 
 
  註冊時間: 2003-11-15 文章: 348
 
  第 1 樓
  | 
		
			
				 發表於: 星期六 十一月 14, 2015 4:18 pm    文章主題: 在Grid的Column加上Container,點擊是會移位一點點, 如何可取消它? | 
				     | 
			 
			
				
  | 
			 
			
				| 在Grid的Column加上Container,Container內是2個Textbox,運行時點擊是會移位一點點, 請問如何可取消它? 在AllowCellSelection=.f.時不太好看 | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		Batman
 
 
  註冊時間: 2003-11-15 文章: 348
 
  第 2 樓
  | 
		
			
				 發表於: 星期二 十一月 17, 2015 10:14 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				| 測試及尋找了幾天, 應是沒解了 | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		syntech
 
 
  註冊時間: 2003-05-16 文章: 4252 來自: Taipei,Taiwan
  第 3 樓
  | 
		
			
				 發表於: 星期二 十一月 17, 2015 10:26 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				LEFT, TOP 改成 -1 呢?
 
或是無邊線呢?
 
 
 
 
其實我不太管這個,不好看就不好看.  XD _________________ 如果公司有下列困擾:
 
1. 找不到便宜,快速,簡易的 生產排程軟體
 
2. 不知道如何快速排定 採購計劃
 
3. 成本抓不準,自己算比軟體算有用
 
4. 想學習系統規劃,想找系統架構的顧問
 
 
請聯絡我們,也許我們幫得上忙 | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		Batman
 
 
  註冊時間: 2003-11-15 文章: 348
 
  第 4 樓
  | 
		
			
				 發表於: 星期二 十一月 17, 2015 11:51 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				| 回syntech, 已試過, 不行的, AllowCellSelection=.t.時, Click Grid祗經過Grid 的mousedown,BeforeRowColChange,AfterRowColChange, MouseUp, 試了在剛說的加nodefault, return .f.等, 全部也不行,在煩惱中.... | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		oldbb
 
 
  註冊時間: 2007-02-28 文章: 83
 
  第 5 樓
  | 
		
			
				 發表於: 星期三 十一月 18, 2015 10:13 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | 代碼: | 	 		  ** Test.prg
 
CREATE CURSOR dd (ff I, f1 I, f2 I)
 
FOR i = 1 TO 100
 
    INSERT INTO dd VALUES (0, i,i*2)
 
ENDFOR
 
GO TOP 
 
 
of = CREATEOBJECT("_Form")
 
of.Show(1)
 
 
DEFINE CLASS _Form as Form
 
    ADD OBJECT Grid1 AS _Grid
 
ENDDEFINE
 
 
DEFINE CLASS _Grid as Grid
 
    Visible = .T.
 
    AllowCellSelection = .F.
 
    nRecno = 0
 
    
 
    PROCEDURE Init
 
        this.Column1.RemoveObject("Text1")
 
        this.Column1.AddObject("Container1", "_Container")
 
        this.Column1.Sparse = .F.
 
        this.Column1.Container1.Width = this.Column1.Width
 
        this.Column1.Container1.Height = this.RowHeight
 
 
        this.Column1.Container1.Text1.Top = 0
 
        this.Column1.Container1.Text1.Left = 0
 
        this.Column1.Container1.Text1.Width = this.Column1.Width/2 - 2
 
        this.Column1.Container1.Text1.Height = this.RowHeight
 
        this.Column1.Container1.Text2.Top = 0
 
        this.Column1.Container1.Text2.Left = this.Column1.Width/2 + 2
 
        this.Column1.Container1.Text2.Width = this.Column1.Width/2 - 2
 
        this.Column1.Container1.Text2.Height = this.RowHeight
 
        this.Column1.Container1.nLeft1 = this.Column1.Container1.Text1.Left
 
        this.Column1.Container1.nLeft2 = this.Column1.Container1.Text2.Left
 
    ENDPROC
 
 
    PROCEDURE AfterRowColChange(nColIndex)
 
        this.nRecno = RECNO()
 
        this.Column1.DynamicForeColor = [IIF(this.nRecno == RECNO(), RGB(255,255,255), RGB(0,0,0))]
 
        this.SetFocus
 
    ENDPROC
 
ENDDEFINE
 
 
DEFINE CLASS _Container as Container
 
    Visible = .T.
 
    BorderWidth = 0
 
    BackStyle = 0
 
    nLeft1 = 0
 
    nLeft2 = 0
 
    ADD OBJECT Text1 as _TextBox WITH ControlSource = "dd.f1 + dd.f2"
 
    ADD OBJECT Text2 as _TextBox WITH ControlSource = "dd.f2 - dd.f1"
 
 
    FUNCTION ForeColor_ASSIGN(vNewVal)
 
            * vNewVal占4个字节,RGB数据结构占3个字节。
 
        *this.BackColor = BITAND(vNewVal, 0x00FFFFFF)
 
        LOCAL nColor
 
        nColor = BITAND(vNewVal, 0x00FFFFFF)
 
        this.Text1.ForeColor = nColor
 
        this.Text2.ForeColor = nColor
 
        IF nColor == RGB(255,255,255)
 
            this.Text1.Left = this.nLeft1 - 1
 
            this.Text2.Left = this.nLeft2 - 1
 
        ELSE
 
            this.Text1.Left = this.nLeft1
 
            this.Text2.Left = this.nLeft2
 
        ENDIF
 
    ENDFUNC
 
ENDDEFINE
 
 
DEFINE CLASS _TextBox as TextBox
 
    Visible = .T.
 
    BorderStyle = 0
 
    BackStyle = 0
 
ENDDEFINE | 	 
  | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		Batman
 
 
  註冊時間: 2003-11-15 文章: 348
 
  第 6 樓
  | 
		
			
				 發表於: 星期三 十一月 18, 2015 12:05 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				| 謝謝OldBB多次相助, 還寫上程式碼, 本來已放棄, 現又重新振作起來了, 又是要用dynamicColor+Assign, 我最弱, 再深入研究及理解一下先, Thanks a lots | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
  	 
	    
  	   | 
 	
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
  | 
   
  
		 |