Results 1 to 5 of 5

Thread: XP buttons style in Toolbar

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Location
    Italy
    Posts
    16

    Question XP buttons style in Toolbar

    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?

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    no it wont ever happen because in vb6 u use activex who are no longer used in .NET

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Location
    Italy
    Posts
    16
    right...
    Ideas about this trouble?

    I'm using XP Pro, VS.NET and VB6

    Thanks

  4. #4
    Member
    Join Date
    Nov 2002
    Location
    Austria
    Posts
    52
    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

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Location
    Italy
    Posts
    16
    Thank you esc!
    I'll try later...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width