Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:如何遍历label控件,将不必要的删除

1楼
zhangjian222200 发表于:2023/9/27 20:47:00
实际测试,下面代码,执行正常
For Each frm As WinForm.Form In Forms
    If frm.Opened AndAlso frm.Name.StartsWith("tingKao") = True Then
        frm.Close()
    End If
Next

能将上面代码,改成遍历label控件么?
希望遍历,使用代码RemoveControl(name)动态删除控件
2楼
zhangjian222200 发表于:2023/9/27 21:17:00
论坛上搜索,找到一部分参考,加上帮助,下述代码实现了
'遍历窗口控件,将不必要的,都删除
For Each c As Winform.Control In Forms("chaKan").Controls
    If c.Name.StartsWith("chaKanLe") Then
        Forms("chaKan").RemoveControl(c.Name)
    End If
Next
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01563 s, 2 queries.