下载中心┊文章中心┊软件分类┊更新软件┊推荐下载┊热门软件┊更新文章┊热门文章
 
《拓文asp.net网站内容管理系统》官方演示站。
 设为首页    
 收藏本站
 作者:黄振安
 
网站首页 开源拓文 .NET编程 网站编程 网页设计 图形图像 数据库 软件工程留言本
    站内搜索:   
您现在的位置: 拓文网络 → 文章中心 → .NET编程 → VB.NET → vb.net 中MDI子窗体对其父窗体属性的[正文]

热 门 文 章

相 关 文 章
  • vb.net 防止MDI子窗体被多次实...
  • vb.net 中MDI子窗体对其父窗体属性的
     
    [作者:不详    转贴自:不详    点击数:    字体:【大 中 小】    更新时间:2006-2-25 15:11:34]

        兄弟前些日子做项目,第一次使用vb.net,碰上不少问题,相信很多初学者多多少少都会遇到这些问题,为了初学者学习方便,小弟总结了一些小经验,供大家参考讨论。
    第一篇:如何在MDI子窗体中控制父窗体的属性等等
    功能:比如打开一个子窗体后,就要设置父窗体中的某个菜单项或者按钮为不可见状态,诸如此类。
    内容:
    MDI父窗体和MDI子窗体类定义如下:
    MDI父窗体:
    Class MDIForm
    Inherits System.Windows.Forms.Form
    .........
    'member mnuMain
    Friend WithEvents mnuEditPaste As System.Windows.Forms.MenuItem
    .......
    'member
    Friend WithEvents toolScan As System.Windows.Forms.ToolBarButton
    private sub showChild()
    dim frmTmp as new MDIChildFom'define a new instantce of MDIChildForm
    frmTmp.MdiParent = me 'set the new form to be a Mdichild
    frmTmp.show() 'show the new form
    end sub
    end Class
    MDI子窗体:
    Class MDIChildForm
    .......
    'set mnuEditPaste & toolScan cannot be seen
    private sub setMDIMnuToolUnvisible()
    '***************************************'
    ' first method you can set a menuitem to be unvisible'
    '***************************************'
    'this method you could not control one MenuItem
    'you can only set a group of menuitems
    me.MdiParent.Menu.Menuitems(0).visible = False 'set the first group menuitem can not be seen
    'with this method you have not right to modify toolScan

    dim frmMdi as MDIForm
    if tyhpeof me.MdiParent is MDIForm
    frmMdi = DirectCast(me.Mdiparent, MDIForm)'get the instantce of me.MdiParent
    'then you should access all the members of class MDIForm without private members
    frmMdi.mnuEditPaste = False
    frmMdi.toolScan = Flase
    'like this you could do everything with MDIForm you want
    end if

    end sub
    end Class

    页次:1/1  1篇/页  首页   上一页   下一页   尾页  合计 1 篇 Go:
     
    上一篇:vb.net 防止MDI子窗体被多次实...
    下一篇:窗体随鼠标一起移动
    winner 打印本页 关闭窗口

         文 章 评 论
    评论人 查看该文章的评论 发表时间
       笔 名* : 0 50分 60分 70分 80分 90分 100分
    评论内容 *: (最多600字。当前字数:0)


    没有相关评论,欢迎您参与!

    - 关于本站 - 网站帮助 - 下载声明 - 友情连接 - 网站地图 -
    Copyright © 2005-2006 myTopWin.Com. All Rights Reserved . [桂ICP备06004496号]