当前位置:网站首页>What should I do to dynamically add a column and button to the gird of VFP?
What should I do to dynamically add a column and button to the gird of VFP?
2022-06-25 11:44:00 【VFP of Garfield】
Today's community zhouboy asked , How can I be dynamic in GRID A dynamic column is added inside , Put a button inside , Tried many methods but failed .
I tried it remotely , If it doesn't trigger success , So I try to accomplish this function in two ways .
Create a new form , As shown in the figure :
It's just one inside GRID, A button , Load the teacher table in the data environment .
Method 1 : Custom class
Save the following code as mycommand.prg
DEFINE CLASS mybutton as CommandButton
PROCEDURE click
MESSAGEBOX("ff2")
ENDPROC
ENDDEFINE
Then in the Add button click Method to write the following code
Thisform.grd Teachers' .AddColumn(7)
Thisform.grd Teachers' .column7.NewObject("mybutton","mybutton","mycommand.prg")
Thisform.grd Teachers' .column7.CurrentControl="mybutton"
Thisform.grd Teachers' .column7.mybutton.Caption=" I'm scared "
Thisform.grd Teachers' .column7.mybutton.visible=.t.
Thisform.grd Teachers' .column7.Sparse=.F.
The operation effect is as follows :
Method 2 :
FORM Form addition command1 Method
Refresh button click Method
Thisform.grd Teachers' .AddColumn(7)
Thisform.grd Teachers' .column7.addobject("mybutton","commandbutton")
Thisform.grd Teachers' .column7.CurrentControl="mybutton"
Thisform.grd Teachers' .column7.mybutton.Caption=" I'm scared "
Thisform.grd Teachers' .column7.mybutton.visible=.t.
Thisform.grd Teachers' .column7.Sparse=.F.
BindEvent(thisform.grd Teachers' .column7.mybutton,"click",thisform,"comm1",0)
It works the same way
follow-up
When I send the form zhouboy When , He looked at my code , Finally, reply in the community , It's a buffer table problem , As a result, the column does not take effect , Now the problem has been solved , I haven't reappeared yet .
More information www.sn58.cn
边栏推荐
- SQL injection vulnerability (bypass)
- Recommend a virtual machine software available for M1 computer
- Why distributed IDS? What are the distributed ID generation schemes?
- 时创能源冲刺科创板:拟募资11亿 年营收7亿净利反降36%
- Record the process of submitting code to openharmony once
- PHP如何提取字符串中的图片地址
- 文献之有效阅读
- SQL注入漏洞(繞過篇)
- Sword finger offer II 091 Painting house: application of state machine DP
- Niuke.com: host scheduling
猜你喜欢
C disk uses 100% cleaning method
What are the ways to simulate and burn programs? (including common tools and usage)
Spark runs wordcount (case 2)
Ladder side tuning: the "wall ladder" of the pre training model
Shichuang Energy sprint Technology Innovation Board: le chiffre d'affaires annuel prévu de 1,1 milliard de RMB est de 0,7 milliard de RMB, en baisse de 36%
How TCP handles exceptions during three handshakes and four waves
Detailed explanation of Flink checkpoint specific operation process and summary of error reporting and debugging methods
芯片的发展史和具体用途以及结构是什么样的
Manually rollback abnormal data
JVM 原理简介
随机推荐
How TCP handles exceptions during three handshakes and four waves
Comparator (for arrays.sort)
Presto Web UI introduction
Spark Tuning common configuration parameters
Convergence by probability
Eureka accesses the console and reports an error: whitelabel error page
Manually rollback abnormal data
Niuke.com: host scheduling
Idea local launch Flink task
基于Minifilter框架的双缓冲透明加解密驱动 课程论文+项目源码
基于超算平台气象预警并行计算架构研究
Crawler scheduling framework of scratch+scratch+grammar
.Net Core 中使用工厂模式
Flink partition policy
Kingbasees plug-in ftutilx of Jincang database
CFCA安心签接入
Openfeign uses
Handler、Message、Looper、MessageQueue
Customize to prevent repeated submission of annotations (using redis)
Ladder Side-Tuning:预训练模型的“过墙梯”