Hi Martin,
I performed some tests based on your description but didn't reproduce the
problem on my side.
The steps of my test are as follows:
1. Create a new Windows Application project
2. In the static Main method, add this line of code:
Application.EnableVisualStyles();
3. Drag two ToolBar controls from Toolbox onto the Form1
4. Drag two ImageLists to Form1
5. Insert some images into the two ImageLists
6. Assign imageList1 to ToolBar1
7. Insert some ToolBarButtons to the toolBar1. Set ImageIndex property for
each button, the image is immediately shown up
8. Add a Button to the Form1and in the Click event handler of this button,
add the following lines of code:
private void button1_Click(object sender, System.EventArgs e)
{
ToolBarButton b1 = new ToolBarButton();
b1.ImageIndex = 1;
this.toolBar2.ImageList = this.imageList2;
this.toolBar2.Buttons.Add(b1);
}
10. Build the project and run it. When I click the button on the
Form1, a ToolBarButton appears in the ToolBar2 with the specified image.
I performed tests in both VS.NET 2003 and VS2005 and got the same result.
The OS of my test machine is Windows Server 2003.
What version of Visual Studio are you using?
What's the OS version on your machine?
Is there any difference between your project and mine?
If the problem still not solved, could you please show us the relevant code
snippet or reproduce the problem in a simple project and send it to me? To
get my actual email address, remove 'online' from my displayed email
address.
I look forward to your reply.
Sincerely,
Linda Liu
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.