? 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亚博优惠活动)
7.1 菜单设计
控件名:menustrip
作用:设计下拉式菜单。
菜单设计方法:当拖入menustrip1控件后,就在窗体的左上角出现菜单设计栏,从而可以输入菜单项(即菜单的TEXT属性)。
常用属性:
Text:设置菜单项名字。其后可带(&f)以指明热键为f(即按下alt+f激活菜单)
Shortcutkeys:快捷键,可以从右边选择修饰符(Ctrl,alt,shift)与键。也可以直接输入。
Image:与菜单项对应的图标。说明,加载图片时,选择资源时从本地资源导入。
Name:菜单名称,默认名称为:text名称ToolStripMenuItem
菜单项之间加分隔线:text栏输入-
应用实例:设计一个菜单,其中菜单栏包括:文件(新建、打开、保存、退出)、编辑(颜色、剪切、复制、粘贴)。而颜色又分为菜单项(红色、绿色、蓝色),单击颜色项可设置文本框中文字颜色并选择此项。单击编辑菜单的其它项能执行相应的操作。
见文件编辑菜单,程序为:
? ?Public Class Form1
??? Private Sub 退出ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 退出ToolStripMenuItem.Click
??????? End
??? End Sub
??? Private Sub 红色ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 红色ToolStripMenuItem.Click
??????? TextBox1.ForeColor = Color.Red
??????? 红色ToolStripMenuItem.Checked = True
??????? 蓝色ToolStripMenuItem.Checked = False
??????? 黑色ToolStripMenuItem.Checked = False
??? End Sub
?
??? Private Sub 蓝色ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 蓝色ToolStripMenuItem.Click
??????? TextBox1.ForeColor = Color.Blue
??????? 红色ToolStripMenuItem.Checked = False
??????? 蓝色ToolStripMenuItem.Checked = True
??????? 黑色ToolStripMenuItem.Checked = False
??? End Sub
?
??? Private Sub 黑色ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 黑色ToolStripMenuItem.Click
??????? TextBox1.ForeColor = Color.Black
????? ??红色ToolStripMenuItem.Checked = False
??????? 蓝色ToolStripMenuItem.Checked = False
??????? 黑色ToolStripMenuItem.Checked = True
??? 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.Cut()
??? End Sub
?
??? Private Sub 粘贴ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 粘贴ToolStripMenuItem.Click
??????? TextBox1.Paste()
??? End Sub
?
??? Private Sub 新建ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 新建ToolStripMenuItem.Click
??????? TextBox1.Text = ""
??? End Sub
End Class
相关亚博优惠活动