欢迎光临极品网,更多、更新的资源信息尽在Jpinw.Com!本站所有信息资源每日更新新的内容,请大家继续关注www.Jpinw.com!如果觉得本站还不错,对您有帮助,别忘了向您的朋友推荐本站!请记好本站网址:http://www.Jpinw.com,网站发展靠大家多多的支持!!!

极品网 极品课件 极品论文 极品文学 极品游戏 极品美容 极品手机资源 极品股票

#
免费资源: 免费域名 | 免费空间 | 免费推广 | 免费邮箱 | 免费硬盘 | 免费论坛 | 免费留言 | 免费统计 | 在线投稿 | 更多...
电脑学院: 操作系统 | 安全相关 | 网页设计 | 编程开发 | 建站经验 | 服务器类 | 黑客攻防 | 菜鸟入门 | 教你网赚 | 更多...
文章导航: 网赚学堂 | 网赚秘笈 | 网赚三维 | 网赚先锋 | 网赚资讯 | 感悟网赚 | 众生百态 | 经典美文 | 范文中心 | 更多...
图酷天下: 时事图酷 | 娱乐图酷 | 搞笑图酷 | 时尚图酷 | 体育图酷 | 另类经典 | 论文资源 | 课件下载 | 文学知识 | 更多...

您现在的位置: 极品网 >> 电脑学院 >> 编程开发 >> 编程综合 >> 教程正文

asp.net 的菜单制作(asp.net 的菜单application)            【字体:
asp.net 的菜单制作(asp.net 的菜单application)
作者:佚名    教程来源:不详    点击数:    更新时间:2008-1-1    

 








asp.net 的菜单制作(asp.net 的菜单application)。
  Imports System
Imports System.ComponentModel
Imports System.Drawing
Imports System.WinForms

Namespace Microsoft.Samples.WinForms.VB.Menus

Public Class Menus
Inherits System.WinForms.Form

Private components As System.ComponentModel.Container
Private label1 As System.WinForms.Label
Private mainMenu As System.WinForms.MainMenu
Private label1ContextMenu As System.WinForms.ContextMenu

Private Class FontSizes
public shared Small As Single = 8f
public shared Medium As Single = 12f
public shared Large As Single = 24f
End Class

'Font face and size
Private fontFace As String = "Arial"
Private fontSize As Single = FontSizes.Medium

'Used to track which menu items are checked/unchecked
Private mmiArial As MenuItem
Private mmiTimesNewRoman As MenuItem
Private mmiCourier As MenuItem
Private mmiSmall As MenuItem
Private mmiMedium As MenuItem
Private mmiLarge As MenuItem
Private cmiArial As MenuItem
Private cmiTimesNewRoman As MenuItem
Private cmiCourier As MenuItem
Private cmiSmall As MenuItem
Private cmiMedium As MenuItem
Private cmiLarge As MenuItem

Private miMainFormatFontChecked As MenuItem
Private miMainFormatSizeChecked As MenuItem
Private miContextFormatFontChecked As MenuItem
Private miContextFormatSizeChecked As MenuItem

Public Sub New()

MyBase.New

' Required by the Windows Forms Designer
InitializeComponent

' TODO: Add any constructor code after InitializeComponent call

label1.Font = new Font(fontFace, fontSize)

'Add File Menu
Dim miFile As MenuItem = mainMenu.MenuItems.Add("&File")
miFile.MenuItems.Add(new MenuItem("&Open...", new EventHandler(AddressOf Me.FileOpen_Clicked), Shortcut.CtrlO))
miFile.MenuItems.Add("-") ' Gives us a seperator
miFile.MenuItems.Add(new MenuItem("E&xit", new EventHandler(AddressOf Me.FileExit_Clicked), Shortcut.CtrlX))

'Add Format Menu
Dim miFormat As MenuItem = mainMenu.MenuItems.Add("F&ormat")

'Font Face sub-menu
mmiArial = new MenuItem("&Arial", AddressOf Me.FormatFont_Clicked)
mmiArial.Checked = true
mmiArial.DefaultItem = true
mmiTimesNewRoman = new MenuItem("&Times New Roman", AddressOf Me.FormatFont_Clicked)
mmiCourier = new MenuItem("&Courier New", AddressOf Me.FormatFont_Clicked)

miFormat.MenuItems.Add( "Font &Face" _
, new EventHandler(AddressOf Me.FormatFont_Clicked) _
, (new MenuItem(){ mmiArial, mmiTimesNewRoman, mmiCourier }))

'Font Size sub-menu
mmiSmall = new MenuItem("&Small", AddressOf Me.FormatSize_Clicked)
mmiMedium = new MenuItem("&Medium", AddressOf Me.FormatSize_Clicked)
mmiMedium.Checked = true
mmiMedium.DefaultItem = true
mmiLarge = new MenuItem("&Large", AddressOf Me.FormatSize_Clicked)

miFormat.MenuItems.Add( "Font &Size" _
, new EventHandler(AddressOf Me.FormatSize_Clicked) _
, (new MenuItem(){ mmiSmall, mmiMedium, mmiLarge }))

'Add Format to label context menu
'Note have to add a clone because menus can't belong to 2 parents
label1ContextMenu.MenuItems.Add(miFormat.CloneMenu)

' Set up the context menu items - we use these to check and uncheck items
cmiArial = label1ContextMenu.MenuItems(0).MenuItems(0).MenuItems(0)
cmiTimesNewRoman = label1ContextMenu.MenuItems(0).MenuItems(0).MenuItems(1)
cmiCourier = label1ContextMenu.MenuItems(0).MenuItems(0).MenuItems(2)
cmiSmall = label1ContextMenu.MenuItems(0).MenuItems(1).MenuItems(0)
cmiMedium = label1ContextMenu.MenuItems(0).MenuItems(1).MenuItems(1)
cmiLarge = label1ContextMenu.MenuItems(0).

[1] [2] 下一篇

 

教程录入:admin    责任编辑:admin 
  • 上一篇教程:

  • 下一篇教程:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关教程
    [我的ASP.net学习历程]有关于
    《Asp.Net Forums2.0深入分析
    ASP.NET 2.0页面性能的考虑
    ASP.NET 2.0打造购物车和支付
    关于ASP.Net中的时间处理
    基于asp.net的web页面动态控
    ASP.NET ViewState 初探 (3)
    ASP.NET/Perl.NET 数据库访问
    ASP.NET: Connection String
    ASP.NET: HtmlEncode/UrlEnc
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    极品网
    | 设为首页 | 加入收藏 | 友情链接 | 版权声明 |
    极品网

    Copyright 2006 Jpinw.com 极品网

    备案号:浙ICP备07010375号

    极品网