How to access DownDropItems in the Context menu?

There is a context menu (with the name MenuNotif) which has a Login paragraph, and subparagraph logout. So logical =)

I can access the login item and change its properties:
MenuNotif.Items["login"].Visible = true;
in this case the Visible property.

But how to access sub-item Logout which is inside a Login?, that's what I can't understand.
July 9th 19 at 13:54
1 answer
July 9th 19 at 13:56
Solution
By heart don't remember because you know how to use Google, IntelliSense, MSDN, what you want, but in General the logic goes like this:
MenuNotif.Items["login"].DropDownItems["logout"].Visible = true;

Maybe not DropDownItems, and other property may need to some type of lead MenuNotif.Items["login"], in short, are looking.

there is 1 element of the Items collection under the name of the login, and in it another element under the name logout

Login, and Logout, as it is not logical.
Quoting "Login, and Logout, as it is not logical." I didn't know how exactly to describe it, maybe like this: There is a context menu which has a Login paragraph, and subparagraph logout. So logical =)

I tried MenuNotif.Items["login"].DropDownItems["logout"].Visible = true; but writes that the DropDownItems. There are such properties at all. I don't even know what to do.

But do that mean That prior to authorization by default, the sub-item logout should be hidden, but after login I have to put the Visible property to True to show it. (Well, I think it was clear to you already.)

Quote "in short, search for" I'm on it all morning dolblyus. Different options tried.

"Google I from you will not soon leave you alone, so you bad luck today =)" - Hildegard26 commented on July 9th 19 at 13:59
You me do not like, and I hope this will help =) - Hildegard26 commented on July 9th 19 at 14:02
: "There is a context menu which has a Login paragraph, and subparagraph logout. So logical =)"
It's not the wording, but in essence, why do so?

"I don't even know what to do.
Oh, I like your "don't know".
Take Google, enter dropdownitems, there's an article from MSDN under the title "the Property of ToolStripDropDownItem.DropDownItems," so we should probably lead type:
(MenuNotif.Items["login"] as ToolStripDropDownItem).DropDownItems.blablabla

"I hope this will help =)"
Yes laziness to me, C# to run quite a long time not writing on it, it is Android, there Java, C++, assembler... - mazie.Towne commented on July 9th 19 at 14:05
: I "(MenuNotif.Items["login"] as ToolStripDropDownItem).DropDownItems.blablabla" don't know much about. Just right now realized how to use them.

(I'm a beginner so this kosyachny, well, hut knowledge of php a little help with the work in C#. Otherwise I would do wouldn't even know what a variable is :D) - Hildegard26 commented on July 9th 19 at 14:08
Another source is to look, really nowhere - neither in books, nor just the Internet - there is no source with similar level structures? This can not be. - mazie.Towne commented on July 9th 19 at 14:11

Find more questions by tags Visual C#