Results 1 to 31 of 31

Thread: Windows Vista & 7 Glass Effect

  1. #1

    Thread Starter
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Talking Windows Vista & 7 Glass Effect

    The glass effect was the reason why i got Microsoft Windows Vista.
    It looks very cool.
    In general Microsoft has a better GUI then Apple Mac OSX 10.6 or 10.7 i lost track.
    But Windows 7 has to be the best OS\GUI in 2009 - 2010.

    With this little code that i have typed up on my typewriter
    your program can look like Windows Explore etc...

    Requirements

    Windows 7 or Vista

    Preview


    Code


    Vb.net Code:
    1. Imports System.Runtime.InteropServices
    2.  
    3. Public Class Form1
    4.     <Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> Public Structure Side
    5.         Public Left As Integer
    6.         Public Right As Integer
    7.         Public Top As Integer
    8.         Public Buttom As Integer
    9.     End Structure
    10.  
    11.     <Runtime.InteropServices.DllImport("dwmapi.dll")> Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As Side) As Integer
    12.     End Function
    13.  
    14.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    15.         Try
    16.             Me.BackColor = Color.Black 'It has to be black
    17.             Dim side As Side = New Side
    18.             side.Left = -1
    19.             side.Right = -1
    20.             side.Top = -1
    21.             side.Buttom = -1
    22.             Dim result As Integer = DwmExtendFrameIntoClientArea(Me.Handle, side)
    23.         Catch ex As Exception
    24.             MessageBox.Show(ex.Message)
    25.  
    26.         End Try
    27.     End Sub
    28. End Class

    Good Luck
    Attached Images Attached Images  
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

  2. #2
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Windows Vista & 7 Glass Effect

    Now that is just plain awesome, especially with how easy it is

    Any idea to how it runs on an XP system?

    Edit: It'll crash in the form load event but that's easy to work around since you can do an OSVersion.Major check before setting the Vista/Win7 api call, which means you're able to use a different theme instead for the older systems

    This is pretty slick
    Last edited by JuggaloBrotha; May 8th, 2010 at 01:55 AM.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  3. #3

  4. #4

    Thread Starter
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by JuggaloBrotha
    Now that is just plain awesome, especially with how easy it is

    Any idea to how it runs on an XP system?

    Edit: It'll crash in the form load event but that's easy to work around since you can do an OSVersion.Major check before setting the Vista/Win7 api call, which means you're able to use a different theme instead for the older systems

    This is pretty slick
    I fixed up the code.
    So now it will check the users OS before loading the glass.
    I mean you can try to download dwmapi.dll and place it to Windows32 Folder but i do not think that it will work.


    =Vb.net Code:
    1. Imports System.Runtime.InteropServices
    2. Public Class Form1
    3.     <Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> Public Structure Side
    4.         Public Left As Integer
    5.         Public Right As Integer
    6.         Public Top As Integer
    7.         Public Buttom As Integer
    8.     End Structure
    9.     <Runtime.InteropServices.DllImport("dwmapi.dll")> Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As Side) As Integer
    10.     End Function
    11.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    12.         Dim strr As String = UCase(My.Computer.Info.OSFullName)
    13.         If strr.Contains("VISTA") Or strr.Contains("WINDOWS 7") Then
    14.             Try
    15.                 Me.BackColor = Color.Black 'It has to be black
    16.                 Dim side As Side = New Side
    17.                 side.Left = -1
    18.                 side.Right = -1
    19.                 side.Top = -1
    20.                 side.Buttom = -1
    21.                 Dim result As Integer = DwmExtendFrameIntoClientArea(Me.Handle, side)
    22.             Catch ex As Exception
    23.                 MessageBox.Show(ex.Message)
    24.             End Try
    25.         Else
    26.             MsgBox("Your OS " & My.Computer.Info.OSFullName.ToString & " Is Supported With Glass.", MsgBoxStyle.Exclamation, "Error Loading dwmapi.dll")
    27.         End If
    28.     End Sub
    29. End Class

    Quote Originally Posted by NickThissen
    It looks great, but I don't know how useful it is, because control on it don't look that great...
    If you were to drag that over a black picture it would look normal.
    But i know that is a bug and i will try to fix it.
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

  5. #5
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by Pc_Not_Mac View Post
    I fixed up the code.
    So now it will check the users OS before loading the glass.
    I mean you can try to download dwmapi.dll and place it to Windows32 Folder but i do not think that it will work.


    =Vb.net Code:
    1. Imports System.Runtime.InteropServices
    2. Public Class Form1
    3.     <Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> Public Structure Side
    4.         Public Left As Integer
    5.         Public Right As Integer
    6.         Public Top As Integer
    7.         Public Buttom As Integer
    8.     End Structure
    9.     <Runtime.InteropServices.DllImport("dwmapi.dll")> Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As Side) As Integer
    10.     End Function
    11.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    12.         Dim strr As String = UCase(My.Computer.Info.OSFullName)
    13.         If strr.Contains("VISTA") Or strr.Contains("WINDOWS 7") Then
    14.             Try
    15.                 Me.BackColor = Color.Black 'It has to be black
    16.                 Dim side As Side = New Side
    17.                 side.Left = -1
    18.                 side.Right = -1
    19.                 side.Top = -1
    20.                 side.Buttom = -1
    21.                 Dim result As Integer = DwmExtendFrameIntoClientArea(Me.Handle, side)
    22.             Catch ex As Exception
    23.                 MessageBox.Show(ex.Message)
    24.             End Try
    25.         Else
    26.             MsgBox("Your OS " & My.Computer.Info.OSFullName.ToString & " Is Supported With Glass.", MsgBoxStyle.Exclamation, "Error Loading dwmapi.dll")
    27.         End If
    28.     End Sub
    29. End Class
    Actually I would use the version number to do the OS check personally:
    Code:
    Imports System.Runtime.InteropServices
    Public Class Form1
        <Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> Public Structure Side
            Public Left As Integer
            Public Right As Integer
            Public Top As Integer
            Public Buttom As Integer
        End Structure
        <Runtime.InteropServices.DllImport("dwmapi.dll")> Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As Side) As Integer
        End Function
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Environment.OSVersion.Platform = PlatformID.Win32NT AndAlso Environment.OSVersion.Version.Major >= 6I Then
                Me.BackColor = Color.Blue 'It doesn't have to be black, Win7 supports all colors
                DwmExtendFrameIntoClientArea(Me.Handle, New Side With {.Left = -1I, .Right = -1I, .Top = -1I, .Buttom = -1I})
            End If
        End Sub
    End Class
    Last edited by JuggaloBrotha; May 8th, 2010 at 04:37 PM.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  6. #6

    Thread Starter
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Re: Windows Vista & 7 Glass Effect

    I believe there is a error in
    Code:
    Imports System.Runtime.InteropServices
    Public Class Form1
        <Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> Public Structure Side
            Public Left As Integer
            Public Right As Integer
            Public Top As Integer
            Public Buttom As Integer
        End Structure
        <Runtime.InteropServices.DllImport("dwmapi.dll")> Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As Side) As Integer
        End Function
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Environment.OSVersion.Platform = PlatformID.Win32NT AndAlso Environment.OSVersion.Version.Major >= 6I Then
                Me.BackColor = Color.Blue 'It doesn't have to be black, Win7 supports all colors
                DwmExtendFrameIntoClientArea(Me.Handle, New Side With {.Left = -1I, .Right = -1I, .Top = -1I, .Buttom = -1I})
            End If
        End Sub
    End Class
    Error message
    Error 1 'System.Runtime.InteropServices.DllImportAttribute' cannot be applied to a Sub, Function, or Operator with a non-empty body. C:\Users\Bill Gates\Documents\Visual Studio 2008\Projects\Glass Effect\Glass Effect\Form1.vb 11 78 Glass Effect
    I might be wrong because i did not take time to look over it
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

  7. #7
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Windows Vista & 7 Glass Effect

    Here's the code I have, it works fine on Win7 x64
    Code:
    Imports System.ComponentModel
    Imports System.Runtime.InteropServices
    
    <DebuggerStepThrough()> _
    Public Class Win7Form
        Inherits System.Windows.Forms.Form
    
        <StructLayout(LayoutKind.Sequential)> _
        Public Structure Side : Public Left, Right, Top, Bottom As Integer : End Structure
    
        <DllImport("dwmapi.dll")> _
        Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As Side) As Integer
        End Function
    
    #Region " Variables "
    
    #End Region
    #Region " Constructor, Dispose "
    
        Public Sub New()
            MyBase.New()
            MyBase.AutoScaleMode = AutoScaleMode.Font
            Call DoWin7(True)
        End Sub
    
        <DebuggerNonUserCode()> _
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            Try
                If disposing Then
                End If
            Finally
                MyBase.Dispose(disposing)
            End Try
        End Sub
    
    #End Region
    
        Private Sub DoWin7(ByVal Enabled As Boolean)
            If Enabled Then
                If Environment.OSVersion.Platform = PlatformID.Win32NT AndAlso Environment.OSVersion.Version.Major >= 6I Then
                    Me.BackColor = Color.Black 'It has to be black
                    DwmExtendFrameIntoClientArea(Me.Handle, New Side With {.Left = -1I, .Right = -1I, .Top = -1I, .Bottom = -1I})
                End If
            Else
                'ToDo: Turn it off
            End If
        End Sub
    
        'ToDo: Create Enabled property
    
    End Class
    I'm making it a user control, that inherits the FW's Form then my actual forms simply inherit this control and has the Areo Glass automatically (yet still works on XP and older as a standard form)
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  8. #8

    Thread Starter
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Re: Windows Vista & 7 Glass Effect

    I will try to fix that bug this week
    Last edited by Pc_Not_Mac; May 9th, 2010 at 05:29 PM.
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

  9. #9
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Windows Vista & 7 Glass Effect

    I have removed several (far too many) off-topic posts.

    While there are vague similarities between the code above and the code here, they are both reasonable implementations based on the actual documentation for DwmExtendFrameIntoClientArea - and it is hard to see how two different implementations could be any less similar than they are.

  10. #10
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: Windows Vista & 7 Glass Effect

    i have problem i would like my text/webbrowser on screen like menustips etc.... so the text is still black not transparent or any colour i choose the text to be how would i do this , but what you have done soo far is awesome just that little hitch i want you to fix some how thanks
    plus webbrowser webpage is transparent i want that back to normal but i want this feature :>
    Last edited by pillhead2007; May 16th, 2010 at 03:30 PM.

  11. #11
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Windows Vista & 7 Glass Effect

    Hello, i get an error saying that this dll dwmapi.dll cannot be found!

    Am using winxp sp2 with vs2005 installed
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  12. #12
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by coolcurrent4u View Post
    Hello, i get an error saying that this dll dwmapi.dll cannot be found!

    Am using winxp sp2 with vs2005 installed
    That would be because XP doesn't have Areo Glass so it wont work. We've also got the OS check so it'll be a normal form on XP and older computers, but be glass on Vista and newer computers automatically
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  13. #13
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Windows Vista & 7 Glass Effect

    can i just copy this dll into my system!

    Please send me the dll

    Thanks
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  14. #14
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by coolcurrent4u View Post
    can i just copy this dll into my system!

    Please send me the dll

    Thanks
    You can, but you'll need all the other dll's too, which means you'll need to turn XP into Vista, Win7 or Server 2008 for the other dll's to work
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  15. #15
    Member
    Join Date
    May 2010
    Posts
    35

    Re: Windows Vista & 7 Glass Effect

    That is frekin awesome! Mind if i use it in one of my projects?

  16. #16
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Windows Vista & 7 Glass Effect

    You can use any of the code on this site in your projects, unless there is something with the code that explicitly says otherwise - and there isn't anything like that here.

  17. #17
    Member
    Join Date
    May 2010
    Posts
    35

    Lightbulb Re: Windows Vista & 7 Glass Effect

    Thats pretty cool, ive already implimented it into my first project! This forum is pretty cool, i've been looking for a place to get support and share with other people using VB, im very new to it lol. Heres how i've put it in my project :P

  18. #18

    Thread Starter
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by FunkyFreddo
    That is freaking awesome! Mind if i use it in one of my projects?
    Yea, You can use it in your projects.

    Its all about code and not money
    Just make sure you add some rep
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

  19. #19
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by FunkyFreddo View Post
    Thats pretty cool, ive already implimented it into my first project! This forum is pretty cool, i've been looking for a place to get support and share with other people using VB, im very new to it lol. Heres how i've put it in my project :P
    Nice good to see someone not going overboard with the glass effect and actually making a sensible use out of it.

    For anyone wanting to do the same thing in WPF, here's an MS article on it (it is ever so slightly different to doing it for a winforms app) : http://msdn.microsoft.com/en-us/library/ms748975.aspx
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  20. #20
    Member
    Join Date
    May 2010
    Posts
    35

    Re: Windows Vista & 7 Glass Effect

    Thanks xD its a pretty cool code snippet ^_^

  21. #21
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by FunkyFreddo View Post
    Thats pretty cool, ive already implimented it into my first project! This forum is pretty cool, i've been looking for a place to get support and share with other people using VB, im very new to it lol. Heres how i've put it in my project :P
    It looks like you were trying to do "Designed & Coded By ..." If you want to use an ampersand then you would have to set your text property to "Designed && Coded By ..."

  22. #22

  23. #23

    Thread Starter
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Re: Windows Vista & 7 Glass Effect

    Call DoWin7
    Can you post the code.
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

  24. #24
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by Pc_Not_Mac View Post
    Can you post the code.
    He probably copy and pasted the code from post #7, which references the Win7 sub that JuggaloBrotha created. Which means he didn't copy that sub.

    The error he said he received was "not declared", which means that whatever Win7 was, it wasn't there. A quick CTRL+F located Win7 and I assumed as much from there =/

    VB.NET Code:
    1. Private Sub DoWin7(ByVal Enabled As Boolean)
    2.         If Enabled Then
    3.             If Environment.OSVersion.Platform = PlatformID.Win32NT AndAlso Environment.OSVersion.Version.Major >= 6I Then
    4.                 Me.BackColor = Color.Black 'It has to be black
    5.                 DwmExtendFrameIntoClientArea(Me.Handle, New Side With {.Left = -1I, .Right = -1I, .Top = -1I, .Bottom = -1I})
    6.             End If
    7.         Else
    8.             'ToDo: Turn it off
    9.         End If
    10.     End Sub
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  25. #25

    Thread Starter
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Re: Windows Vista & 7 Glass Effect

    I need to spend some time and fix the many bugs
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

  26. #26
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by Pc_Not_Mac View Post
    I need to spend some time and fix the many bugs
    That has nothing to do with this... but okay.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  27. #27
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by Emcrank View Post
    Mine says that
    Code:
    Call DoWin7
    is not declared or something. What shall i do?
    That's because you copied it from my post, but you didn't copy the entire code...
    Quote Originally Posted by Pc_Not_Mac View Post
    Can you post the code.
    See my post waaay at the top.
    Quote Originally Posted by weirddemon View Post
    He probably copy and pasted the code from post #7, which references the Win7 sub that JuggaloBrotha created. Which means he didn't copy that sub.

    The error he said he received was "not declared", which means that whatever Win7 was, it wasn't there. A quick CTRL+F located Win7 and I assumed as much from there =/
    Yep
    Quote Originally Posted by Pc_Not_Mac View Post
    I need to spend some time and fix the many bugs
    I'd kind of forgotten about it since it's not a control I'm thinking of using, I can finish what my code had started sometime later this weekend.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  28. #28

    Thread Starter
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Re: Windows Vista & 7 Glass Effect

    This code is pretty cool.
    You can use it as the background of toolbox or like menu option box thing or wizard.
    If you use it for a word editor the application might look like cr...p .
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

  29. #29
    Lively Member
    Join Date
    Nov 2009
    Posts
    76

    Re: Windows Vista & 7 Glass Effect

    Quote Originally Posted by NickThissen View Post
    It looks great, but I don't know how useful it is, because control on it don't look that great...

    Is there nothing we can do about this?
    Nick: I have heard of ways to prevent it from doing that, but I don't know exactly what they are. I think it might have to do with Owner/Custom Drawing and such. You might try contacting the folks at Paint.NET, as they have a few buttons on glass.(If they reply, or you figure it out, please post it ) Personally, I use a slightly modified version of a 'Glass effects extender library' I found on CodeProject. You may be able to learn a couple things about Glass from that (I hope that this is not taking away from your audience, Pc_Not_Mac)
    If I helped you in any way, please add to my reputation

    Controls:
    Vista/7 Style Progress Bar

  30. #30
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Windows Vista & 7 Glass Effect

    Okay, I have actually found out a way around the "horrible text" problem. For each control you need to "fix", subclass it and add this:

    Code:
    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
         e.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
         MyBase.OnPaint(e)
    End Sub
    Apparently ClearType causes the problem. You can also set the TextRenderingHint to AntiAliasGridFit or SingleBitPerPixel. SingleBitPerPixelGridFit makes the text disappear and ClearTypeGridFit is the default which you don't want.

    P.S. Sorry for bumping up an old thread but I'm sure at least some people still want this
    Last edited by minitech; Feb 9th, 2011 at 09:56 PM.

  31. #31
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Windows Vista & 7 Glass Effect

    lol good old ClearType... causes more problems than its worth if you ask me!
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


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