Solved

How to create a multiline contextmenustrip?

Posted on 2009-06-30
4
533 Views
Last Modified: 2013-11-27
I want to create a multiline contextmenustrip,i.e.,I want to have 1 menu multiline and the rest single line.I tried inserting "&vbnewline" at runtime while assigning the text property,it worked but the height of all the other menus increased as well.I want to know if its possible to keep the height of all menu constant and just increase 1 in a single contextmenustrip.Thanx for any cooperation.
0
Comment
Question by:Amitava_Mukherjee
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 24752635
Hi,
 
You can define the AutoSize property to false and define your own size.
Example:

        Dim item As New ToolStripMenuItem
        item.AutoSize = False
        item.Size = New Size(120, 100)
        item.Text = "line 1" & vbNewLine & "line 2"
        Me.ContextMenuStrip1.Items.Add(item)

Open in new window

0
 

Author Comment

by:Amitava_Mukherjee
ID: 24753327
Nice Solution :-).
One small hickup, Other menus are increased in height slightly in the same context menu.
Any Suggestion?
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 250 total points
ID: 24753428
Can you show a screenshot ?
0
 

Author Closing Comment

by:Amitava_Mukherjee
ID: 31598653
Thanx
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question