Solved

How to create a multiline contextmenustrip?

Posted on 2009-06-30
4
540 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

734 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