Foxtable(狐表)用户栏目专家坐堂 → 如何编程改变控件的名称


  共有2636人关注过本帖平板打印复制链接

主题:如何编程改变控件的名称

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:109489 积分:557107 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/10/15 12:05:00 [只看该作者]

应该是改变标题吧,不建议改控件名称。

使用代码改的,在窗口设计器是看不出的。

For Each c As WinForm.Control In e.form.controls
output.show(c.name)
    If Typeof c Is WinForm.TextBox Then
        Dim t As WinForm.TextBox = c
        If t.name = "TextBox8" Then
            t.name = "123456"
        End If
    End If
Next
output.show(e.form.ExistControl("TextBox8"))
output.show(e.form.ExistControl("123456"))

 回到顶部