-
Sep 15th, 2014, 09:40 AM
#1
Thread Starter
Addicted Member
[RESOLVED] How to handle MenuStripBar Layout?
Hello again folks.
I know the title sounds vague, so I'll cut to the chase.
I have a MenuStripBar control, that holds several items. I'm able to show them all if I keep my main form window maximized at all times, but if I resize it (i.e. check several windows), a few of those items will be hidden.
So, what's the best approach to handle this situation? Add a button when there's items that are hidden and when you press that button, the remaining menus will be displayed as a submenu from that button? Add buttons to navigate the MenuStripBar control?
None of the mentioned before?
I'm up for any ideas, preferably the most efficiente ones
Note: If my explanation or questions weren't clear enough, let me know and I'll post a few images.
Last edited by Simbiose; Sep 16th, 2014 at 04:35 AM.
Reason: Messed up the contents of the thread ...
-
Sep 15th, 2014, 04:19 PM
#2
Re: How to handle ToolStripBar Layout?
what's the best approach to handle this situation? Add a button when there's items that are hidden and when you press that button, the remaining menus will be displayed as a submenu from that button?
This is what the ToolStrip control do by default! when the form resized and there isn't enough space to show all button, a dropdown button appears which show the hidden buttons as menu.
Yo can also change that by setting the property LayoutStyle to Flow
-
Sep 16th, 2014, 04:01 AM
#3
Thread Starter
Addicted Member
Re: How to handle ToolStripBar Layout?
Originally Posted by 4x2y
This is what the ToolStrip control do by default! when the form resized and there isn't enough space to show all button, a dropdown button appears which show the hidden buttons as menu.
Yo can also change that by setting the property LayoutStyle to Flow
Oh crap I messed up!
I meant about the MenuStripBar control, not the ToolStripBar control.
Sorry about that. I've fixed my post and thread x.x
-
Sep 16th, 2014, 04:21 AM
#4
Re: How to handle MenuStripBar Layout?
Try CanOverflow , Overflow ?
Code:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
MenuStrip1.CanOverflow = True
For i = 0 To MenuStrip1.Items.Count - 1
MenuStrip1.Items(i).Overflow = ToolStripItemOverflow.AsNeeded
Next
End Sub
-
Sep 16th, 2014, 04:34 AM
#5
Thread Starter
Addicted Member
Re: How to handle MenuStripBar Layout?
Originally Posted by Edgemeal
Try CanOverflow , Overflow ?
Code:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
MenuStrip1.CanOverflow = True
For i = 0 To MenuStrip1.Items.Count - 1
MenuStrip1.Items(i).Overflow = ToolStripItemOverflow.AsNeeded
Next
End Sub
Oh wow, I had no idea there was such a method built-in for MenuStripBar control O.o
Thanks a lot
Now I just need to apply the same logic to the StatusStripBar control :P
-
Sep 16th, 2014, 04:55 AM
#6
Re: How to handle MenuStripBar Layout?
Originally Posted by Simbiose
Oh wow, I had no idea there was such a method built-in for MenuStripBar control O.o
Thanks a lot
Now I just need to apply the same logic to the StatusStripBar control :P
The sizing grip makes it really hard to select the button in the StatusStrip, if I disable that it seems to work pretty good,
Code:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
MenuStrip1.CanOverflow = True
MenuStrip1.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow
For Each item As ToolStripItem In MenuStrip1.Items
item.Overflow = ToolStripItemOverflow.AsNeeded
Next
StatusStrip1.SizingGrip = False
StatusStrip1.CanOverflow = True
StatusStrip1.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow
End Sub
Last edited by Edgemeal; Sep 16th, 2014 at 05:08 AM.
Reason: REPOST
-
Sep 16th, 2014, 05:30 AM
#7
Thread Starter
Addicted Member
Re: How to handle MenuStripBar Layout?
Originally Posted by Edgemeal
The sizing grip makes it really hard to select the button in the StatusStrip, if I disable that it seems to work pretty good,
Code:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
MenuStrip1.CanOverflow = True
MenuStrip1.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow
For Each item As ToolStripItem In MenuStrip1.Items
item.Overflow = ToolStripItemOverflow.AsNeeded
Next
StatusStrip1.SizingGrip = False
StatusStrip1.CanOverflow = True
StatusStrip1.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow
End Sub
Yep, that works. However it's not suitable for my case, as I have a mute/unmute sound button on the farther right side on the StatusStripBar control.
If apply your code, it'll be flowed along with all the other items as close as possible to the left
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|