Connecting Tech Pros Worldwide Forums | Help | Site Map

MDI Form Problem

Newbie
 
Join Date: Jun 2007
Posts: 17
#1: Aug 31 '08
I have file menu items in my mdi form as

File
-------------
Log - In
--------------
Exit
---------------



after click on Log-In , Log -in form will be appeared. If user is authenticated with database with correct user and password.


I want want to visible this menu item on mdi form which is invisible before.


File
-----------------
Log - In
-----------------
Registration
------------------
Course
Module
Subject
-------------------
Exit
-------------------


on the basis of user authentication . I don't know how to do this I have never developed MDI application before using dotnet.


Please help me out with this problem I am very confused . I was developing in vb6.0 its so easy there but here I am not getting how to go for this.

Thanks



joedeene's Avatar
Site Addict
 
Join Date: Jul 2008
Location: US of A
Posts: 587
#2: Sep 1 '08

re: MDI Form Problem


ehh in vb.net 2008 why not just show those menu items but set the *ENABLED* property to false ? meaning they cannot click on it, and it is just not enabled, the events will not happen for those menu items, until you set the enabled property to true in code...

like in the form load event, or you could do change it in the properties toolbox (in designer view)

code:
Expand|Select|Wrap|Line Numbers
  1. 'form load event
  2.  RegistrationToolStripMenuItem.Enabled = False
Expand|Select|Wrap|Line Numbers
  1. 'form authentication success event
  2.  RegistrationToolStripMenuItem.Enabled = True

also try looking into the .Visible property of the particular menu items ? hope i helped.

joedeene
PRR PRR is offline
Moderator
 
Join Date: Dec 2007
Location: India
Posts: 700
#3: Sep 2 '08

re: MDI Form Problem


In your main form.. that is the one with menu.. declare public static objects of all other forms....
public static formchild f2;
When a user clicks a main form menu item... initialize the new form....

i had done similar thing... though the main form would be in the background.... i guess u can either disable it .. or reference it to another static object n hide it ....
Reply


Similar .NET Framework bytes