Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / May 2008

Tip: Looking for answers? Try searching our database.

TooStripMenuItem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SetonSoftware - 28 May 2008 21:02 GMT
I'm using  VB.NET 2005 and we need menu items that have both the
Checked property set to True and an Image as well. Something like
this:

oMenuItem = mnuFiles.DropDownItems.Add(strText,
imgList.Images("MyImage"), AddressOf File_Click)
oMenuItem.Checked = True

I'd like both to display adjacent to one another. It seems that the
Image property will sit on top of the check mark. Is there any way to
have both? The ony way we could think of was to create an image that
combined the check mark and our image but the display is way too
small. Any other ideas?

Thanks

Carl
Marcin Dzióbek - 29 May 2008 11:09 GMT
Hi Carl:

> I'm using  VB.NET 2005 and we need menu items that have both the
> Checked property set to True and an Image as well. Something like
[quoted text clipped - 9 lines]
> combined the check mark and our image but the display is way too
> small. Any other ideas?

If mnuFiles is ToolStripMenuItem, You may use ShowCheckMargin and ShowImageMargin properties like here:
'**************************************************************************************
   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       Dim mnuFiles As New ToolStripMenuItem("Files...")
       Dim oMenuItem As ToolStripMenuItem
       oMenuItem = mnuFiles.DropDownItems.Add("BeepFile", New Bitmap("c:\tmp\x.bmp"), AddressOf File_Click)
       oMenuItem.Checked = True
       CType(oMenuItem.Owner, ToolStripDropDownMenu).ShowCheckMargin = True
       CType(oMenuItem.Owner, ToolStripDropDownMenu).ShowImageMargin = True
       Me.ContextMenuStrip = New ContextMenuStrip
       Me.ContextMenuStrip.Items.Add(mnuFiles)
   End Sub
   Private Sub File_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
       Beep()
   End Sub
'**************************************************************************************
If not, try search VS2005's help for "How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls"

--
Marcin

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.