我以編程命令方式在表單中按下指定命令鈕后會產生一個Grid表格,所編程式為:
thisform.grid1.recordsource="商品銷售"
thisform.grid1.ColumnCount=6
thisform.grid1.column1.controlsource='商品銷售.編號'
thisform.grid1.column2.controlsource='商品銷售.銷售日期'
thisform.grid1.column3.controlsource='商品銷售.商品名'
thisform.grid1.column4.controlsource='商品銷售.單位'
thisform.grid1.column4.controlsource='商品銷售.數量'
thisform.grid1.column6.controlsource='商品銷售.銷售價'
thisform.grid1.column1.header1.caption='編號'
thisform.grid1.column2.header1.caption='銷售日期'
thisform.grid1.column3.header1.caption=''商品名'
thisform.grid1.column4.header1.caption='單位'
thisform.grid1.column5.header1.caption='數量'
thisform.grid1.column6.header1.caption='銷售價'
thisform.grid1.column1.width=80
thisform.grid1.column2.width=120
thisform.grid1.column3.width=120
thisform.grid1.column4.width=50
thisform.grid1.column5.width=20
thisform.grid1.column6.width=30
現在需要在該表格的第1列text1控制元件的dblclick事件撰寫如下命令程式,并加入到以上程式中:
thisform.container1.text1.Value=https://bbs.csdn.net/topics/商品銷售.編號
thisform.container1.text2.Value=https://bbs.csdn.net/topics/商品銷售.銷售日期
thisform.container1.text3.Value=https://bbs.csdn.net/topics/商品銷售.商品名
thisform.container1.text4.Value=https://bbs.csdn.net/topics/商品銷售.數量
thisform.container1.text5.Value=https://bbs.csdn.net/topics/商品銷售.銷售價
敬向電腦專家請教,如何通過編程方式對表單表格的第1列text1控制元件的dblclick事件撰寫命令程式?敬請批導,不勝感激!
uj5u.com熱心網友回復:
用字串執行命令比如定義一個全域或者private 字串陣列a(100)
再DBclick()事件寫:
for i=1 to 100
if a(i)<>''
&a(i)
end if
end for
然后在其他代碼處寫
for i=1 to 100
a(i)=''
end for
a(1)="thisform.container1.text1.Value='https://bbs.csdn.net/topics/商品銷售.編號'"
a(2)="thisform.container1.text2.Value='https://bbs.csdn.net/topics/商品銷售.銷售日期'"
a(3)="thisform.container1.text3.Value='https://bbs.csdn.net/topics/商品銷售.商品名'"
a(4)="thisform.container1.text4.Value='https://bbs.csdn.net/topics/商品銷售.數量'"
a(5)="thisform.container1.text5.Value='https://bbs.csdn.net/topics/商品銷售.銷售價'"
這樣DbCLIck就可以執行了
uj5u.com熱心網友回復:
或者定義一個字串也可以用字串執行命令
比如定義一個全域或者private 字串數b
DBclick()事件寫:
if b<>''
&b
end if
然后在其他代碼處寫
b="thisform.container1.text1.Value='https://bbs.csdn.net/topics/商品銷售.編號'"+chr(13)+"thisform.container1.text2.Value='https://bbs.csdn.net/topics/商品銷售.銷售日期'"+chr(13)+"thisform.container1.text3.Value='https://bbs.csdn.net/topics/商品銷售.商品名'"+chr(13)+"thisform.container1.text4.Value='https://bbs.csdn.net/topics/商品銷售.數量'"+chr(13)+"thisform.container1.text5.Value='https://bbs.csdn.net/topics/商品銷售.銷售價'"
這樣DbCLIck就可以執行了
uj5u.com熱心網友回復:
這個需要動態系結代碼uj5u.com熱心網友回復:
十豆三老師:過去,我有很多問題多次向您請教,受益非淺,非常感謝!
這次又向您請教一個問題,耽擱您寶貴的時間。
我以編程命令方式在表單中按下指定命令鈕后會產生一個Grid表格,所編程式為:
thisform.grid1.recordsource="商品銷售"
thisform.grid1.ColumnCount=6
thisform.grid1.column1.controlsource='商品銷售.編號'
thisform.grid1.column2.controlsource='商品銷售.銷售日期'
thisform.grid1.column3.controlsource='商品銷售.商品名'
thisform.grid1.column4.controlsource='商品銷售.單位'
thisform.grid1.column4.controlsource='商品銷售.數量'
thisform.grid1.column6.controlsource='商品銷售.銷售價'
thisform.grid1.column1.header1.caption='編號'
thisform.grid1.column2.header1.caption='銷售日期'
thisform.grid1.column3.header1.caption=''商品名'
thisform.grid1.column4.header1.caption='單位'
thisform.grid1.column5.header1.caption='數量'
thisform.grid1.column6.header1.caption='銷售價'
thisform.grid1.column1.width=80
thisform.grid1.column2.width=120
thisform.grid1.column3.width=120
thisform.grid1.column4.width=50
thisform.grid1.column5.width=20
thisform.grid1.column6.width=30
現在需要在所編表格中具有一個功能:雙擊該表格的其行第1列,會在表單中的指定的文本框中顯示表格這一行的欄位資料。
于是,我在上面的程度中添加了以下程式:
procedure thisform.grod1.column1.text1.dblclic
thisform.container1.text1.Value=https://bbs.csdn.net/topics/商品銷售.編號
thisform.container1.text2.Value=https://bbs.csdn.net/topics/商品銷售.銷售日期
thisform.container1.text3.Value=https://bbs.csdn.net/topics/商品銷售.商品名
thisform.container1.text4.Value=https://bbs.csdn.net/topics/商品銷售.數量
thisform.container1.text5.Value=https://bbs.csdn.net/topics/商品銷售.銷售價
endproc
但在運行時,電腦卻出現了出錯提示,指出:procedure thisform.grod1.column1.text1.dblclic命令中含有不能識別的短語或關鍵字。
敬向您請教,如何通過編程方式對表單表格的第1列text1控制元件的dblclick事件撰寫命令程式?敬請批導,不勝感激!
uj5u.com熱心網友回復:
procedure thisform.grod1.column1.text1.dblclic寫錯了吧,少了個字母 k
procedure thisform.grod1.column1.text1.dblclick
uj5u.com熱心網友回復:
我以編程命令方式在表單中按下指定命令鈕后會產生一個Grid表格。現在需要所產生的表格中具有一個功能:雙擊該表格的其行第1列,會在表單中的指定的文本框中顯示表格這一行的欄位資料。
于是,我中添加了以下程式:
procedure thisform.grod1.column1.text1.dblclicK
thisform.container1.text1.Value=https://bbs.csdn.net/topics/商品銷售.編號
thisform.container1.text2.Value=https://bbs.csdn.net/topics/商品銷售.銷售日期
thisform.container1.text3.Value=https://bbs.csdn.net/topics/商品銷售.商品名
thisform.container1.text4.Value=https://bbs.csdn.net/topics/商品銷售.數量
thisform.container1.text5.Value=https://bbs.csdn.net/topics/商品銷售.銷售價
endproc
但在運行時,電腦卻出現了出錯提示,指出:procedure thisform.grod1.column1.text1.dblclick命令中含有不能識別的短語或關鍵字。
敬向電腦專家請教,如何通過編程方式對表單表格的第1列text1控制元件的dblclick事件撰寫命令程式?敬請批導,不勝感激!
uj5u.com熱心網友回復:
https://wenku.baidu.com/view/6de3e619960590c69fc37677.html 參考下bindevent()轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/81780.html
標籤:VFP
上一篇:小白問題,求大神幫忙看看這種寫法能否在集群環境下執行java版本的
下一篇:mysql 多欄位匹配一個值設計
