Foxtable(狐表)用户栏目专家坐堂 → 如何设置焦点到菜单文本框


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

主题:如何设置焦点到菜单文本框

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/3/28 9:03:00 [显示全部帖子]

添加菜单

 

Dim C1Ribbon1 As C1Ribbon.C1Ribbon  = Ctype(BaseMainForm.controls("C1Ribbon1"),C1Ribbon.C1Ribbon )

Dim a As New Windows.Forms.TextBox
a.Text = "123456789"
a.Font = new font("宋体", 20)
a.backColor = color.red
Dim b As New C1Ribbon.RibbonControlHost(a)
b.name = "自定义项1"
b.width = 300
C1Ribbon1.tabs("Other").Groups("Export").Items.Add(b)
vars("a") = a

 

设置焦点代码

 

vars("a").Select


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/3/30 8:54:00 [显示全部帖子]

全局代码

 

Public Sub TextBox1_TextChanged(sender As Object, e As EventArgs)
    msgbox(sender.text)
End Sub

 

调用代码

 

Dim C1Ribbon1 As C1Ribbon.C1Ribbon  = Ctype(BaseMainForm.controls("C1Ribbon1"),C1Ribbon.C1Ribbon )

Dim a As New Windows.Forms.TextBox
a.Text = "123456789"
a.Font = new font("宋体", 20)
a.backColor = color.red
Dim b As New C1Ribbon.RibbonControlHost(a)
b.name = "自定义项1"
b.width = 300
C1Ribbon1.tabs("Other").Groups("Export").Items.Add(b)
vars("a") = a
addhandler a.textchanged, addressof textbox1_textchanged


 回到顶部