Click here to Skip to main content
14,872,753 members
Please Sign up or sign in to vote.
4.33/5 (2 votes)
See more:
hi,

i want to create a menustrip in right hand side like treeview.

i am using visual studio 2010, i drag and drop the menustrip, its automatically going upside of the window and i am check all properties there is no chance to display in right hand side...

i want to create like..

window have two sides ( left and right )
right side have the menu strip like treeview,that is have click event
and click the particular menu corresponding window shows the left side






Regards
Anand Rajan
Posted
Updated 16-Dec-13 19:41pm
v2

There are several ways you can create this kind of UI design.

1. Drop a MenuStrip Control on your Form: add ToolStripMenuItems to create your top-level Menu Entries, and add sub-menus as needed.

a. set its Dock Property to 'Right. Note that if you set a DockStyle, then the 'Stretch Property, and the Height component of the Size Property are, essentially, ignored: the MenuStrip will size itself vertically to fit its ContainerControl/Form.

b. set its LayoutStyle Property to 'VerticalStackWithOverflow

If this doesn't meet your needs, then please modify your original post, and be more specific about what you are designing.

Also: have you thought of actually using a TreeView Control instead of a nested Menu ?
   
Comments
An@nd Rajan10 17-Dec-13 2:31am
   
thanks
actually the sub menu are not visible that is inside id the menu...that is my problem i want show all sub menus with menu like tree view...
that is possible..
BillWoodruff 17-Dec-13 6:38am
   
If I understand your design intention correctly, then I think you really don't want to use a menu. Why not use a TreeView: you can certainly force all its nodes to remain expanded/visible; a TreeView can show scroll-bars if necessary, etc.
An@nd Rajan10 17-Dec-13 8:24am
   
yes, but how to express in tree view
Assume you have a TreeView, Docked 'Right on a Main Form.

You make sure all TreeNodes are expanded in the Form Load EventHandler:
C#
private void Form1_Load(object sender, EventArgs e)
{
    treeView1.ExpandAll();
}
And, you force all its nodes to remain expanded by using this BeforeExpand EventHandler:
"cs"
private void treeView1_BeforeCollapse(object sender, TreeViewCancelEventArgs e)
{
    e.Cancel = true;
}
At that point you need to define what you want to do when a TreeNode, or TreeNodes, is/are clicked, or selected.

To help you with that, we need to know more details: will clicking each TreeNode ... no matter what level they are at in the TreeView ... trigger the display of some other Form, or of some container Control, like a Panel, inside the same form the TreeView is on ? Is multiple-selection allowed: if so, what happens if there is a multiple-selection ?
   
Comments
An@nd Rajan10 17-Dec-13 11:02am
   
ok i click the node then displays the corresponding window ,its possible or not ???
BillWoodruff 17-Dec-13 15:34pm
   
Yes, it's possible. But, what do you mean by "window:" another Form ?

The details of what you are displaying in the "windows" you will open in response to TreeView Node clicks will influence the design.

If you want further assistance, then take the time to answer the questions asked in detail; we're not psychics :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900