473,385 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C#::Hiding MenuStrip in MDIParent

40
hi

i am creating a login page.Inthe form load itself i need to hide the MenuStrip in MDI Parent to HIDE, When the users gives the correct passwd and pushes the Loginbutton , My MDIParent1 forms menustrip should be visible .

c my code . but it doesnt works. Any body pls clear my doubt.

Expand|Select|Wrap|Line Numbers
  1.  
  2.         private void LoginForm_Load(object sender, EventArgs e)
  3.         {
  4.             MDIParent1 mdifrm = new MDIParent1();
  5.  
  6.             mdifrm.menuStrip.Visible = false;
  7.  
I had created formobj mdifrm and made it visible false on load. this also not works.

Expand|Select|Wrap|Line Numbers
  1.  private void btnLogin_Click_1(object sender, EventArgs e)
  2.         {
  3.                  if (strPasswd == dsUsers.Tables[0].Rows[0].ItemArray[0].ToString())
  4.                 {
  5.                     this.mdifrm.menuStrip.Visible = true;
  6.                     this.Hide();
  7.                 }
  8.                 else
  9.                 {
  10.                     MessageBox.Show("Incorrect Password","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
  11.                 }
  12.  
  13.             }
  14.  
  15.  
thanks in adv

kssk
Dec 20 '07 #1
3 6546
debasisdas
8,127 Expert 4TB
desable the menu items at design time and enable those after succesful enable only.
Dec 20 '07 #2
ssknov
40
My code doesnt works , even if i am right

i am hiding my MDI's menustrip in its load, when i click the button in form2 it should be visible. i tried in my code. it wont works. pls c my code again.

help me

thanks
kssk
Dec 20 '07 #3
For those who are still interested..

He forgot to add the mdifrm.Show(); call so the form was never showed to him in the first place.
Jul 11 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Alvo von Cossel I | last post by:
hi, i have a modern looking application without the cotrolbox-bar because i've created my own. i have a restore down button with an image that has a grey background. if the user has a different...
0
by: rellik | last post by:
Hi All, I've run into a problem with the MenuStrip control and any help would be greatly appreciated! The problem I've got is that when use a control derived from the MenuStrip class all MDI...
0
by: academic | last post by:
Using ToolStripManager.Merge(ToolStrip,ToolStrip) I've been able to merge a MenuStrip into a MenuStrip but never a ContextMenuStrip into a MenuStrip. From the docs it seems to me I should be...
0
by: Chris Peeters | last post by:
Hi, I have an MDI-application running with 1 MDI chilld showing in 'Normal'-WindowState, so NOT maximized. What I see is the MDI-main window showing its title bar, below that the menustrip with...
1
by: Schwammkopf | last post by:
Hi ! I'm using Visual Studio 2005 Professional Edition and C#. I have a simple question: I want to add to my form, which is a scrollable control, a menustrip and statusstrip. The problem is...
0
by: active | last post by:
For the last 3 or 4 days I've been, on an off, searching the Internet and theVS2005 Doc for an example of how to add a contextmenustrip to a menustrip. I can move all the items from a...
3
by: Gav | last post by:
I am using a MenuStrip on a form and adding a Panel to the same form in the program. When the Panel is added the top of the Panel is behind the MenuStrip, so the top of the Panel is hidden. How do...
0
by: kyungdongkim | last post by:
Hi, I have a dynamically generated MenuStrip following this example: http://www.codeproject.com/useritems/Dynamic_MenuStrip.asp Basically the menu strip allows users to save and load reports. ...
7
by: swatii | last post by:
I am using C#.net.My problem is that I have a MDI Parent form and on that I have menustrip control which i have disabled at the time of load of MDI parent.Now I have MDI child login form. Now If...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.