|
-
May 8th, 2005, 01:21 PM
#1
Drawing on the VisualStyles Layer
Does anyone have any sample VB.NET code for doing such?
I have been over this article but its for VB6 and a bit generic. I'm looking to draw on a toolbar button, an image of the
back arrow and forward arrow under XP SP2.

Original thread located here.
This sample is without the VisualStyle enabled since the image of a toolbar button is only available without the visual style.
Also if how to draw the arrows so they are smoother around the edges and less jaggie.
Thanks for any assistance.
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 
-
May 8th, 2005, 02:22 PM
#2
Re: Drawing on the VisualStyles Layer
Does this look like the correct translation of the C++ call?
VB Code:
HRESULT SetWindowTheme(HWND hwnd,
LPCWSTR pszSubAppName,
LPCWSTR pszSubIdList
);
Private Declare Function SetWindowTheme Lib "uxtheme.dll" (ByVal hWnd As Int32, _
ByVal pszSubAppName As String, ByVal pszSubIdList As String) As Int32
From MS:
The theme manager retains the pszSubAppName and the pszSubIdList associations through the lifetime of the
window, even if visual styles subsequently change. The window is sent a WM_THEMECHANGED message at the
end of a SetWindowTheme call, so that the new visual style can be found and applied.
When pszSubAppName and pszSubIdList are NULL, the theme manager removes the previously applied associations.
To prevent visual styles from being applied to a specified window, pass an empty string, (L" "), which will not match
any section entries.
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 
-
May 8th, 2005, 03:13 PM
#3
Re: Drawing on the VisualStyles Layer
Here is the link over at M$ for all the C++ calls in case anyone whats to assist.
I figure I need OpenThemeData, ClosethemeData, DrawThemeBackground, DrawThemeIcon, DrawThemeText, etc.
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 
-
May 9th, 2005, 07:09 AM
#4
Re: Drawing on the VisualStyles Layer
What do you mean it's not visible? Are you putting the Application.DoEvents() call in after you enable the visual styles?
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
May 9th, 2005, 10:59 AM
#5
Re: Drawing on the VisualStyles Layer
Yes its in there, but the issue is the the imagelist images associated with the toolbar draw on the toolbar layer and if I have VS enabled
they are draw on a secondary layer above the toolbar, like a skinning effect. Thus, they are covered by the VS and can not be seen.
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 
-
May 11th, 2005, 11:57 PM
#6
Re: Drawing on the VisualStyles Layer
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 
-
May 19th, 2005, 12:01 AM
#7
Re: Drawing on the VisualStyles Layer
I got a few minutes more to work on this and these are the four API calls involved in extracting the themem bitmap data.
OpenThemeData
DrawThemeParentBackground
DrawThemeBackground
CloseThemeData
More to come...
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 
-
May 19th, 2005, 12:54 AM
#8
Lively Member
Re: Drawing on the VisualStyles Layer
 Originally Posted by RobDog888
Also if how to draw the arrows so they are smoother around the edges and less jaggie.
Why don't you try investigate into using alpha transparency on the images? That is the best way, but I'm not sure about the code. Well, hey, At least I gave you an idea of what to look for
I never know what to put in this section...

So sue me... ... ... I'm just kidding...
www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!
-
May 19th, 2005, 10:33 AM
#9
Re: Drawing on the VisualStyles Layer
Thanks for the suggestion but I believe that there must be an easier way to draw them. Perhaps if it can get the APIs to draw
correctly it will take care of itself since I was drawing below the vs layer.
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 
-
May 19th, 2005, 08:02 PM
#10
Re: Drawing on the VisualStyles Layer
 Originally Posted by RobDog888
Yes its in there, but the issue is the the imagelist images associated with the toolbar draw on the toolbar layer and if I have VS enabled
they are draw on a secondary layer above the toolbar, like a skinning effect. Thus, they are covered by the VS and can not be seen.
I'm a bit mystified by this thread. I have projects with VisualStyles enabled and I don't have issues with toolbar buttons not displaying images. Are you calling DoEvents() after EnableVisualStyles()? Sorry if this is covering old ground but I don't understand why there is an issue at all.
-
May 19th, 2005, 08:06 PM
#11
Re: Drawing on the VisualStyles Layer
I have even tried creating new test projects of nothing more then a form and a toolbar. Associated the imagelist but not images ever show up.
If I turn off the VS then they appear. Either way it is interesting to figure out how its all done instead of just making the call .EnableVisualStyles.
It would be great if it shows with no effort...
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 
-
May 19th, 2005, 08:23 PM
#12
Re: Drawing on the VisualStyles Layer
This code works for me. If it doesn't for you then that's just wierd!
VB Code:
Shared Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New Form1)
End Sub
-
May 19th, 2005, 08:31 PM
#13
Re: Drawing on the VisualStyles Layer
Yes, I know how to enable them. If that was the issue I would have solved it immediatly.
frmMain contains my toolbar but the images do show if I have the VS turned on.
VB Code:
'Simplified example....
Module modMain
Public goMain As New frmMain
Public Sub Main()
Application.EnableVisualStyles
Application.DoEvents
Application.Run(goMain)
End Sub
End Module
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 
-
May 19th, 2005, 09:13 PM
#14
Re: Drawing on the VisualStyles Layer
Your problem is the point at which you are instantiating your startup form. I tried this
VB Code:
Shared Sub Main()
Dim mainForm As New MainWindow
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(mainForm)
End Sub
and the toolbar images do not display. You must have to instantiate your form after the call to EnableVisualStyles or DoEvents or both.
Edit: Just tested and it is both.
-
May 19th, 2005, 09:18 PM
#15
Re: Drawing on the VisualStyles Layer
Sounds logical. I will test it out in a test proj. I have a few inherited forms and I was always getting errors from the inherited forms
not being set to an object so I had to make them New.
Maybe if this works this way I will reorganize the logic structure so I wont have to use inherited forms.
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 
-
May 19th, 2005, 11:24 PM
#16
Re: Drawing on the VisualStyles Layer
jmcilhinney, you were correct! How about that. I wasted several hours researching drawing on the theme layer. Although it is cool
to do (probably will still learn more on it )
I am going to see if I can redesign my two forms that are inheirting or anyother workaround to incorporate this so the toolbar images draw.
Thanks so much for spotting the issue.
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 
-
May 20th, 2005, 12:25 AM
#17
Re: Drawing on the VisualStyles Layer
Happy to help. I'm guessing you'll be helping me in the not-too-distant future so I don't mind building up some early credit.
-
May 20th, 2005, 12:30 AM
#18
Re: Drawing on the VisualStyles Layer
I'll try to make sure I pay my debt. Wouldnt want it to go into collections. 

But I still want to know how to draw so I will update the thread as I get the info.
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 
-
May 20th, 2005, 02:12 AM
#19
Member
Re: Drawing on the VisualStyles Layer
Using visual styles is not recommended as it is a bug in VS.NET and instead you could always use a manifest file for your application.
-
May 20th, 2005, 02:57 AM
#20
Re: Drawing on the VisualStyles Layer
Whats wrong with using GDI+ for drawing stuff? Antialiasing is dead simple too.
I don't live here any more.
-
May 20th, 2005, 03:29 AM
#21
Lively Member
-
May 20th, 2005, 10:39 AM
#22
Re: Drawing on the VisualStyles Layer
The images are loaded into a imagelist by way of the .AddStrip function. You only need to specify the imagelists .TransparentColor color
in order to create the mask.
I had thought of using the manifest method but I need to be able to turn the threme styles for my app only in my apps Option dialog.
Last edited by RobDog888; May 20th, 2005 at 10:43 AM.
Reason: Type-O
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 
-
May 20th, 2005, 10:44 AM
#23
Re: Drawing on the VisualStyles Layer
Also, I need to be able to detect if the tmemes are turned on in my app?
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 
-
May 20th, 2005, 11:16 AM
#24
Re: Drawing on the VisualStyles Layer
Found the call for detecting if a theme is activated for your app by using the IsThemeActive API.
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 
-
May 20th, 2005, 12:11 PM
#25
Re: Drawing on the VisualStyles Layer
Actually I found a better API to tell if your app is running themes.
IsAppThemed
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 
-
May 20th, 2005, 01:06 PM
#26
Re: Drawing on the VisualStyles Layer
Being able to turn on and off themes, even with manifest files should be easy...
Just embed the manifest file as a resource and when the user wants visual styles enabled, write it to a file in the applications directory, and require a restart. To disable visual styles just delete the manifest file.
Edit: Link: http://www.codeproject.com/dotnet/ManifestInjection.asp
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
May 20th, 2005, 01:15 PM
#27
Re: Drawing on the VisualStyles Layer
Thanks, I'll try it. Would I be able to do the same thing with theme api calls? ActivateTheme/DisableTheme? I think that would
be for the entire OS.
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 
-
May 20th, 2005, 03:33 PM
#28
Re: Drawing on the VisualStyles Layer
I could not locate any Info on the ActivateTheme/DisableTheme API class, so I'm not sure.... I would check MSDN documentation(I couldn't find any)
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
May 21st, 2005, 08:40 AM
#29
Re: Drawing on the VisualStyles Layer
Looks like I could do it without using a manifest by calling the theme apis. SetWindowTheme looks promising. I will have to also use other theme apis but it can be done.
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 
-
May 23rd, 2005, 12:35 PM
#30
Re: Drawing on the VisualStyles Layer
Why cant I get a handle to the theme data on my form? I am using the OpenThemeData API but I get nothing.
VB Code:
Public Declare Function OpenThemeData Lib "uxtheme.dll" (ByVal hwnd As IntPtr, ByRef pszClassList As String) As IntPtr
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lHwnd As IntPtr
Try
lHwnd = OpenThemeData(Me.Handle, "Button")
MessageBox.Show(lHwnd.ToString)
CloseThemeData(lHwnd.ToInt32)
Catch ex As Exception
MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK)
End Try
End Sub
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 
-
May 23rd, 2005, 09:42 PM
#31
Hyperactive Member
Re: Drawing on the VisualStyles Layer
Rob, could you explain abit on how you fixed the Toolbar image issue? I am just starting to convert over and my first project is working with the toolbar and VisualStyles would be nice to have but also I want my toolbar images Thank you for any help
-
May 23rd, 2005, 09:52 PM
#32
Re: Drawing on the VisualStyles Layer
It was because of the order that the forms were being instanciated before the Application.EnableVisualStyles(). Enable the VS first
before any forms are set or dimmed with New.
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 
-
May 24th, 2005, 10:36 PM
#33
Re: Drawing on the VisualStyles Layer
*BUMP*
Any help on why I cant open the theme data and get a hendle?
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 
-
Jun 5th, 2005, 08:36 PM
#34
Re: Drawing on the VisualStyles Layer
Everbody who wants visual style support should stop phaffing about and get over to www.skybound.ca to download their free VisualStyles component. It fixes almost all visual style issues with almost no effort on the part of the developer. If you want specific theming for your app that is a different story, although they do offer a paid-for theming component as well.
-
Jun 6th, 2005, 12:51 AM
#35
Re: Drawing on the VisualStyles Layer
Yes, basically thats what I am trying to do, custom theming for my user control and a toolbar. No possibility for paying them, only for me
to learn how to do it myself.
Interesting link though. Think I will add it to my favorites just in case.
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 
-
Jun 6th, 2005, 01:04 AM
#36
Re: Drawing on the VisualStyles Layer
 Originally Posted by RobDog888
Yes, basically thats what I am trying to do, custom theming for my user control and a toolbar. No possibility for paying them, only for me
to learn how to do it myself.
Interesting link though. Think I will add it to my favorites just in case. 
Sorry, I realise that you are trying to learn the details. I had intended my previous post more for the other folks who were asking general visual style questions
-
Jun 6th, 2005, 10:24 AM
#37
Re: Drawing on the VisualStyles Layer
No prob. Its a good link and I do appreciate any help you may be able to provde.
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 
-
Jun 9th, 2005, 08:04 AM
#38
Junior Member
Re: Drawing on the VisualStyles Layer
Hi,
Add 'Auto' to your function declaration and it should be fine:
VB Code:
Public Declare Auto Function OpenThemeData Lib "uxtheme.dll" (ByVal hwnd As System.IntPtr, ByVal pszClassList As String) As System.IntPtr
Kevin
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
|