visual styles with arraylist BOGUS!
wow, .net 2003 bogus?
try using visual styles on a form...
using:
VB Code:
Public Sub New(Optional ByVal arg As String = "%sysroot%")
MyBase.New()
InitializeComponent()
Application.EnableVisualStyles()
Application.DoEvents()
End Sub
- Create an image list with images
- Create a listview with property LargeImageList set to the created imagelist...
NO ICONS APEAR!
:confused:
remove visual styles...
ICONS APEAR!
:eek:
I've been trying to find out what's wrong in HOURS now... please help anyone?! :confused:
Re: visual styles with arraylist BOGUS!
The EnableVisualStyles function must be the first call before any code is executed or forms created. If your first form is the startup object then place in the New procedure like you have but I wonder if you have other code or objects that are executed or called first.
Re: visual styles with arraylist BOGUS!
RD - given the code above, I'd say so.... EnableVisualStyles is the third line in the code there......
-tg
Re: visual styles with arraylist BOGUS!
Yes, it seems I am here but not here lately. :(
Glad to have the backup :)
Ps, can you check out my thread on stored procedure parameter? :D
Re: visual styles with arraylist BOGUS!
Quote:
Originally Posted by RobDog888
The EnableVisualStyles function must be the first call before any code is executed or forms created. If your first form is the startup object then place in the New procedure like you have but I wonder if you have other code or objects that are executed or called first.
..... The visual styles work perfectly.
Just try it yourself.... the damn icons don't display on the listview if the visual styles are enabled!
Re: visual styles with arraylist BOGUS!
Post your code as it does work on listviews. Did you move your EnableVisualStyles code?
Re: visual styles with arraylist BOGUS!
If you're using VisualStyles you should be using a Main method as your startup object. In that Main method you would do this:
VB Code:
Application.EnableVisualStyles()
Application.DoEvents()
'Add any other code here.
Application.Run(New Form1)
The reason you aren't seeing the images is because of a bug in visual style support whereby if you are using an ImageList you MUST call DoEvents before your startup form is created, i.e. in a Main method. This bug is documented.