文章目錄
- vb.net中MDI子表單對其父表單內容的擷取與修改
vb.net中MDI子表單對其父表單內容的擷取與修改
Class MDIChildForm<br />.......<br /> 'set mnuEditPaste & toolScan cannot be seen<br /> private sub setMDIMnuToolUnvisible()<br /> '***************************************'<br /> ' first method you can set a menuitem to be unvisible'<br /> '***************************************'<br /> 'this method you could not control one MenuItem<br /> 'you can only set a group of menuitems<br /> me.MdiParent.Menu.Menuitems(0).visible = False 'set the first group menuitem can not be seen<br /> 'with this method you have not right to modify toolScan<br /> dim frmMdi as MDIForm<br /> if tyhpeof me.MdiParent is MDIForm<br /> frmMdi = DirectCast(me.Mdiparent, MDIForm)'get the instantce of me.MdiParent ; 'then you should access all the members of class MDIForm without private members<br /> frmMdi.mnuEditPaste = False<br /> frmMdi.toolScan = Flase<br /> 'like this you could do everything with MDIForm you want<br /> end if</p><p> end sub<br />end Class