Solved

How to create a multiline contextmenustrip?

Posted on 2009-06-30
4
535 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

749 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