加好友 发短信
等级:九尾狐
帖子:2927
积分:20167
威望:0
精华:0
注册:2012/2/3 17:45:00
|
页面显示问题 Post By:2015/3/31 17:52:00 [只看该作者]
老师,
Button 生成后,如何点击它,转到对应界面
Dim pidx As object Dim tname As String Dim idx As Integer If e.Sender.Name.StartsWith("btn_tabcontrol") Then pidx = vars("p1_pidx") tname = e.Sender.Name.split("_")(1) idx = e.Sender.Name.split("_")(2).replace("pg", "") End If If pidx IsNot Nothing Then For Each k As String In pidx.keys '显示所有值 Dim btn As WinForm.Button = e.Form.Controls(pidx(k)) If pidx(k) = e.Sender.Name Dim tab As WinForm.TabControl = e.Form.Controls(tname) tab.SelectedIndex = idx 'tab.SelectedPage = tab.TabPages(pidx) 希望点击BUtton 相应的界面显示在最前面 btn.BackColor = Color.red Else btn.BackColor = Color.white End If Next End If
|
|