|
-
Mar 12th, 2006, 12:38 AM
#1
Thread Starter
Fanatic Member
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!
remove visual styles...
ICONS APEAR!
I've been trying to find out what's wrong in HOURS now... please help anyone?!
-
Mar 12th, 2006, 12:52 AM
#2
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 12th, 2006, 01:44 AM
#3
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
-
Mar 12th, 2006, 01:58 AM
#4
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?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 12th, 2006, 11:01 AM
#5
Thread Starter
Fanatic Member
Re: visual styles with arraylist BOGUS!
 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!
-
Mar 12th, 2006, 02:52 PM
#6
Re: visual styles with arraylist BOGUS!
Post your code as it does work on listviews. Did you move your EnableVisualStyles code?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 12th, 2006, 04:27 PM
#7
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|