Solved

images into each ToolStripMenuItem

Posted on 2008-06-18
3
347 Views
Last Modified: 2008-07-27
I need to add two images into each ToolStripMenuItem
0
Comment
Question by:tetoo
3 Comments
 
LVL 19

Accepted Solution

by:
Stephen Manderson earned 500 total points
ID: 21818022
As it stands you cant add 2 images to a ToolStripMenuItem

You can only assign one image at any one time, you could however change the image depending on user actions such as setting the image property to an image list with your 2 images. and could then use the mouse over and mouse up (Or any other properties for that matter) and change the image depending on the state.

Heres an example. Add an imagelist to your form and have your 2 images.

Regards
Steve
    Private Sub ToolStripButton1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ToolStripButton1.MouseDown
        'You could have the image change when the mouse is over the menu item
        ToolStripButton1.Image = ImageList1.Images.Item(0)
    End Sub
 
    Private Sub ToolStripButton1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ToolStripButton1.MouseUp
        'You could then have it change back again to the second image
        ToolStripButton1.Image = ImageList1.Images.Item(1)
    End Sub

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Close form "before" open 3 49
Regex validation 2 28
Sending receiving text messages in vb.net 15 48
VB.net Progress Bar - Maximum Value too large 2 16
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

820 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