[2008] Newbie: Adding Image from Imagelist to Menustrip Item

R

Rob W

Greetings,

I have created an Imagelist for the intended usage of allowing icons (.ico)
for use with my menustrip items.

Looking at the properties of the top level menustrip I could not see a
property to associate an ImageList.
For the individual menustrip items their is an image property, through the
interface I could not see a way of associating items from the Imagelist.

I then attempted to place the code below in the form load of which brings up
a syntax error along the lines of being unable to associate the item as
differing types.


NewCtrlNToolStripMenuItem.Image = imgList.Images[1];

Can anyone help resolve this issue?


Cheers
Rob
 
C

Cor Ligthert[MVP]

Rob,

Are you sure you have the right newsgroup.

It seems a little bit very much C#

In VB you don't need the semicolun and the index is always between ()

(You know that 0 is the first one, a little bit from hardware coding)

Cor
 
R

Rob W

How embarrassing thanks, I'm studying multiple languages and got in a mess.

Yes, all is ok now.
Thanks

Cor Ligthert said:
Rob,

Are you sure you have the right newsgroup.

It seems a little bit very much C#

In VB you don't need the semicolun and the index is always between ()

(You know that 0 is the first one, a little bit from hardware coding)

Cor

Rob W said:
Greetings,

I have created an Imagelist for the intended usage of allowing icons
(.ico) for use with my menustrip items.

Looking at the properties of the top level menustrip I could not see a
property to associate an ImageList.
For the individual menustrip items their is an image property, through
the interface I could not see a way of associating items from the
Imagelist.

I then attempted to place the code below in the form load of which brings
up a syntax error along the lines of being unable to associate the item
as differing types.


NewCtrlNToolStripMenuItem.Image = imgList.Images[1];

Can anyone help resolve this issue?


Cheers
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top