How can I display toolbar's button in XP style?
Actually, if I insert a button in toolbar's collection it appears in old 2000 style...
I have installed VB6 after VB.NET... maybe that VB6 installation overwrite some NET user control's DLL? :rolleyes:
Printable View
How can I display toolbar's button in XP style?
Actually, if I insert a button in toolbar's collection it appears in old 2000 style...
I have installed VB6 after VB.NET... maybe that VB6 installation overwrite some NET user control's DLL? :rolleyes:
no it wont ever happen because in vb6 u use activex who are no longer used in .NET
right... :rolleyes:
Ideas about this trouble?
I'm using XP Pro, VS.NET and VB6
Thanks ;)
1. you have to use a manifest-file. this file must be located in the same order where your exe-file is
name of exe-file: test.exe
name of manifest-file: text.exe.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
2. the property flatstyle has to be set to 'system'... you can use the following recursive procedure so you dont have to do this for every element
Public Sub SetFlatStyle(ByVal ctrls As Control.ControlCollection)
Dim c As Control
For Each c In ctrls
If TypeOf c Is ButtonBase Then
CType(c, ButtonBase).FlatStyle = FlatStyle.System
ElseIf TypeOf c Is GroupBox Then
CType(c, GroupBox).FlatStyle = FlatStyle.System
End If
SetFlatStyle(c.Controls)
Next
End Sub
The system must support 'themes'... you can proof this with the following statement:
if osfeature.feature.ispresent(osfeature.themes) then
...
end if
Thank you esc! :cool:
I'll try later...