Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to create a multiline contextmenustrip?

Posted on 2009-06-30
4
Medium Priority
?
561 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 1000 total points
ID: 24753428
Can you show a screenshot ?
0
 

Author Closing Comment

by:Amitava_Mukherjee
ID: 31598653
Thanx
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

783 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