Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: VBNET
Expertise: Intermediate
Mar 2, 2002



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Multi-column menus

The new Break and BarBreak properties of the MenuItem object let you create menus with multiple columns. All you have to do is set either property to True for the MenuItem object that must become the first item of a new menu column. The only difference between these two properties is that BarBreak displays a vertical line among adjacent columns, whereas Break does not.

A minor annoyance attached to these properties is that they don't appear in the Properties window, so you have to set them via code, as you see here:

mnuFileItem6.BarBreak = True
You can place this statement in the InitializeComponent procedure (the one generated by the form designer), at the end of the New method, or in the Form_Load event procedure. Using the latter two locations ensure that your code isn't overwritten by the form designer when you change another property of the same MenuItem object.
Francesco Balena
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date