My toolbar button's image is missing

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Can Anybody tell me why my toolbar button's image is missing when my app is
run, While the image is well enough in design time ?
 
Peter,
In addition to the other comments.

Did you call Application.EnableVisualStyles in your Sub Main?

If you did you also need to call Application.DoEvents.

Something like:
Public Class MainForm

... designer generated code

Public Shared Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MainForm)
End Sub

End Class

There is a bug in the visual styles that if you do not call DoEvents, then
some controls (such as ToolBar) do not paint correctly at run time.

The alternative to the EnableVisualStyles is to use a manifest for the
themes, such as you would under VB.NET 2002 (.NET 1.0)

Hope this helps
Jay
 
Peter said:
I've got it, thank you all.

I have been following this thread because i have the same problem.
Unfortunately neither of those solutions has helped.
I am completely stumped at the moment.
Has anyone any other ideas?
Thanks
 
i tried all the solutions that mentioned here and also the msdn but
still i havent solve the problem.

anyone has other else solutions?
 
i tried all the solutions that mentioned here and also the msdn but
still i havent solve the problem.

anyone has other else solutions?

USENET???
 
Back
Top