473,378 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Why do my icons randomly appear?

Hello,

I have an issue with images that appear and then seem to disappear depending
on the compile and exectution sequence I use. I haven't been able to narrow
down a repeateable sequnce. I suspect this is an initialization problem. I
wonder if anyone else knows how to fix this?

In my C# Form Load() method, I include the following (m_ToolBarImageList is
defined as a instance ImageList):

m_ToolBarImageList = new ImageList();
m_ToolBarImageList.ImageSize = new System.Drawing.Size(16, 16);
m_ToolBarImageList.TransparentColor = System.Drawing.Color.Transparent;

// Read images from a compiled resource
m_ToolBarImageList.Images.Add(Image.FromStream(Uti lities.GetIconAsStream("Resources.icons.Aladdin_16 x16.ico")));
m_ToolBarImageList.Images.Add(Image.FromStream(Uti lities.GetIconAsStream("Resources.icons.FAB_16x16. ico")));

// Assign the image list to the toolbar
this.toolBar1.ImageList = m_ToolBarImageList;

this.toolBar1.Buttons[0].ImageIndex=0;
this.toolBar1.Buttons[1].ImageIndex=1;
Jul 21 '05 #1
1 1234
Hello,

I assume you haven't marked your Main Method with
the right Appartment Model...

[STAThread]
public static void Main()

You have to mark it as single threaded.

HTH, Günther
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: drum118 | last post by:
Has anyone experience problems with firewall blocking some icons and not others. I am using Zone alarm and have the popup set for medium and it was blocking some of the icons for some strange...
1
by: Ronny | last post by:
Hi, When ever I use image lists in a tree view the image list is behaving inconsistent. When I add images they first look good and clean, after I have close and open the code in the IDE the...
1
by: Dave | last post by:
Hello, I have an issue with images that appear and then seem to disappear depending on the compile and exectution sequence I use. I haven't been able to narrow down a repeateable sequnce. I...
3
boxfish
by: boxfish | last post by:
I'm using Windows XP. Sometimes when I log on to my user, the icons on my desktop will appear as soon as the blue "Loading your personal settings" screen is done and I can start running programs...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.