INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Menu Items on Winforms... disabled going down, enabled going up...

Menu Items on Winforms... disabled going down, enabled going up...

Menu Items on Winforms... disabled going down, enabled going up...

(OP)
Is this normal?

I have a form with a menu bar on it, one of the options, which has a sub-menu, is disabled.

If I move the mouse cursor down the list the result is perfect, you can hover over the item
in question and the sub-menu does not appear - great.

If I then move one (enabled) item down, the sub-menu for that item appears - correctly...

But if I now move back up, and hover over the disabled item, the sub-menu for it appears and
I can click on the sub-menu items that shouldn't be available.

In fact, this isn't just an up/down thing, if I hover over ANY menu item with sub-items, I can then access
the disabled ones sub-menu items as well.

This can't be right can it?

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

RE: Menu Items on Winforms... disabled going down, enabled going up...

Which version of .NET are you targeting and how did you disable the menu?

I did a little test (4.5 framework) and then I disabled by just going into the code and adding the Enabled = false. Working perfectly.

CODE --> C#

// 
            // subMenuTwoToolStripMenuItem
            // 
            this.subMenuTwoToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.subMenu2x1ToolStripMenuItem,
            this.subMenu2x2ToolStripMenuItem});
            this.subMenuTwoToolStripMenuItem.Enabled = false;
            this.subMenuTwoToolStripMenuItem.Name = "subMenuTwoToolStripMenuItem";
            this.subMenuTwoToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
            this.subMenuTwoToolStripMenuItem.Text = "Sub Menu Two"; 

RE: Menu Items on Winforms... disabled going down, enabled going up...

(OP)
Hi

It's .NET framework 4.0.30319, visual studio 2010

I ended up just making it invisible, but it's really annoying, because sometimes you want users
to see what would be available if they logged in or whatever

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

RE: Menu Items on Winforms... disabled going down, enabled going up...

Hmmm. Are you launching it initially enabled and then disabling it in the code, or the other way around?

RE: Menu Items on Winforms... disabled going down, enabled going up...

(OP)
I am disabling it in code, from an enabled state.

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

RE: Menu Items on Winforms... disabled going down, enabled going up...

How strange; even changing it to work that way I can't seem to reproduce the issue you're having.

RE: Menu Items on Winforms... disabled going down, enabled going up...

(OP)
It's not behaviour I would expect.

I'm not disabling the submenu items individually, just the parent, and it only 'reenables' the
submenu items if I hover over another (any other) enabled menu items with sub items.

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close