toolbar doesn't display icon

A

Adam Debowski

Hi,

I've developed an windows forms app in VS Pro 2003, where I use toolbar with
icons.
When I open form in design mode, the icons are displayed, but when I run the
app
the toolbar doesn't display them.
When I run that app under Windows 98, the toolbar displays icons but under
Windows XP - doesn't.

Does anyone know why and how can I fix it?

Adam D
 
M

Michael Powell

I have no clue why you have this problem, but have you tried manualy
refreshing the toolbars controls like so:

protected override void OnPaint(PaintEventArgs e)
{
foreach(Control c in toolBar1.Controls)
c.Invalidate();

base.OnPaint(e);
}

I know its bad practice but it may well work to refresh your toolbar
correctly.

--
Mike Powell
Ramuseco Limited
www.ramuseco.com
P.S: is your toolbar a custom toolbar, or is it the standard
toolbox'toolbar? if its a custom toolbar, what have you removed the
base.OnPaint(e) call from the overrided paint method?
 
A

Adam Debowski

Hi,

I've noticed, when I disables the XP style in my application (to comment
'Application.EnableVisualStyles())
everything works OK .
Why?
or I don't know something.

Adam D
 

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