delphi 清空dbgrd和StringGrid


本文整理自网络,侵删。

 
界面中有dbgrd和StringGrid,做“清空”操作,需求中要求清空信息包括清空所有的下拉列表、文本框以及dbgrd和StringGrid。

//文本框

edt1.Text := '';

//下拉列表

cbb1.ItemIndex:=-1;

//清空dbgrd

dbgrd1.DataSource.DataSet.Close;

dbgrd1.Refresh;

//清空StringGrid

for   i:=1   to   strngrd1.rowcount   do
begin
      for   j:=1   to   strngrd1.colcount   do
          strngrd1.cells[j-1,i-1]:='';

end;

――――――――――――――――
原文链接:https://blog.csdn.net/camillect/article/details/81033657

相关阅读 >>

Delphi winapi: getcurrentthread、getcurrentthreadid、getcurrentprocess、getcurrentprocessid

Delphi messagebox 和 messagedlg用法

Delphi webbrowser设置自己定义user-agent

Delphi webbrowser1使用进度条查看浏览器状态

Delphi webbrowser全选\复制\粘贴

Delphi shellexecute打开文件另类用法

Delphi spcomm的一些用法注意

Delphi listview中加载图片

Delphi侦测按键输入

Delphi 取相同字符串 2种方法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...