Foxtable(狐表)用户栏目专家坐堂 → 如何字符串转换为枚举,如字符串“ControTypeEnumButton”,转换为枚举ControTypeEnumButton


  共有3077人关注过本帖树形打印复制链接

主题:如何字符串转换为枚举,如字符串“ControTypeEnumButton”,转换为枚举ControTypeEnumButton

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/6/13 12:24:00 [显示全部帖子]

动态编译

 

Functions.remove("函数")
Dim Code As String
Code = "msgbox(123) '你要执行的代码"
Functions.Add("函数",Code)
Functions.Complie()
Functions.Execute("函数")


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/6/13 14:23:00 [显示全部帖子]

怎么不成功?我测试没问题啊,可以添加

 

Dim lbl As WinForm.Control
Dim Type As ControlTypeEnum = ControlTypeEnum.Parse(Gettype(ControlTypeEnum),"TextBox")
lbl = e.Form.CreateControl("控件", Type)
lbl.Left = 100
lbl.Top = 100
e.Form.AddControl(lbl)


 回到顶部