? vb.net亚博优惠活动之弹出式菜单设计 亚博优惠活动,亚博体育网页版,亚博app怎么下载「官网直营」
VB.net 2010 视频亚博优惠活动 VB.net 2010 视频亚博优惠活动 VB.net 2010 视频亚博优惠活动
SQL Server 2008 视频亚博优惠活动 c#入门经典亚博优惠活动 Visual Basic从门到精通视频亚博优惠活动
  • vb.net亚博优惠活动之弹出式菜单设计

  • 2015-01-18 10:31 来源:未知
弹出式菜单设计(相关vb.net亚博优惠活动)
控件名称:contextmenustrip1
作用:设计弹出式菜单。
设计方法:
1、拖入contextmenustrip1控件,设计菜单。
2、为菜单添加一个拖盘控件如textbox1(即在此控件上右击则弹出菜单)。
3、建立弹出菜单与拖盘控件的关连:奖textbox1的contextmenustrip属性设置为contextmenustrip1。
属性设置:同菜单设计。
应用实例:设计一个弹出式菜单以控件文件框中文字的颜色,并对文字进行剪切、复制、粘贴操作。[实验报告29]
见弹出菜单控制文本颜色及剪切复制粘贴,程序为:
Private Sub 红色ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 红色Menu.Click
??????? TextBox1.ForeColor = Color.Red
?? ?????红色Menu.Checked = True
??????? 绿色Menu.Checked = False
??????? 蓝色Menu.Checked = False
??? End Sub
?
??? Private Sub 绿色Menu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 绿色Menu.Click
??????? TextBox1.ForeColor = Color.Green
?? ?????红色Menu.Checked = False
??????? 绿色Menu.Checked = True
??????? 蓝色Menu.Checked = False
??? End Sub
?
??? Private Sub 蓝色Menu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 蓝色Menu.Click
??????? TextBox1.ForeColor = Color.Blue
??? ????红色Menu.Checked = False
??????? 绿色Menu.Checked = False
??????? 蓝色Menu.Checked = True
??? End Sub
?
??? Private Sub 剪切ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 剪切ToolStripMenuItem.Click
??????? TextBox1.Cut()
??? End Sub
?
??? Private Sub 复制ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 复制ToolStripMenuItem.Click
??????? TextBox1.Copy()
??? End Sub
?
??? Private Sub 粘贴ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 粘贴ToolStripMenuItem.Click
??????? TextBox1.Paste()
??? End Sub
相关亚博优惠活动