By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,456 Members | 1,372 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,456 IT Pros & Developers. It's quick & easy.

Problem with Toolbar and ImageList

P: n/a
Hi,
I am writing a windows application. To my form I have added a
ToolBar componenet and have created a collection of buttons within it.
I have also created an ImageList, where I have loaded the collection
of images into this component.

In the toolbar component I set the ImageList property with the the one
created. In the collection of buttons of the same toolbar, I start to
index the buttons with images. In the design view the images are
visible on the icons, but when I execute the application, no images
are seen.

Can someone help me out.
Thanks in Advance
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
hi,

weird indeed, it should work fine,
do this, debug the app and see if the ImageList is initialized and if the
images are loaded, the images by defualt are compiled as resources inside
the .exe

this code should be inside InitiateComponent() method.

I cannot think of any other possible cause

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Xarky" <be*********@yahoo.com> wrote in message
news:bc*************************@posting.google.co m...
Hi,
I am writing a windows application. To my form I have added a
ToolBar componenet and have created a collection of buttons within it.
I have also created an ImageList, where I have loaded the collection
of images into this component.

In the toolbar component I set the ImageList property with the the one
created. In the collection of buttons of the same toolbar, I start to
index the buttons with images. In the design view the images are
visible on the icons, but when I execute the application, no images
are seen.

Can someone help me out.
Thanks in Advance

Nov 16 '05 #2

P: n/a
Hi,
I added in the Windows Form Method I added the following,

toolBar1.ImageList = imageList;
toolBarButton1.ImageIndex = 0;
toolBarButton2.ImageIndex = 1;
..etc
toolBar1.Refresh();

and now they can be seen in the executed program.

I checked the "Windows Form Designer Generated Code" and that code
snippet as shown above is there, but it still won't work as supposed.

Its really strange :S

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.