Click here to Skip to main content
15,879,535 members
Articles / Programming Languages / Visual Basic

VDialog (Vista TaskDialog for Windows XP)

Rate me:
Please Sign up or sign in to vote.
4.91/5 (71 votes)
27 Mar 2013LGPL34 min read 276.6K   2.6K   244  
Vista-like TaskDialog control for .NET Framework 2.0, compatible with Windows XP
''' <summary>
''' Label which measures its size in a “message box”-like way.
''' </summary>
Friend Class Label

    Public Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        LinkColor = Color.FromArgb(0, 102, 204)
        ActiveLinkColor = LinkColor
        DisabledLinkColor = Color.FromArgb(126, 133, 156)

    End Sub

    Public Overrides Function GetPreferredSize(ByVal proposedSize As System.Drawing.Size) As System.Drawing.Size

        proposedSize = MyBase.GetPreferredSize(proposedSize)
        Dim w As Integer = Screen.FromControl(Me).WorkingArea.Width \ 2
        proposedSize.Width = [If](w < proposedSize.Width, w, proposedSize.Width)
        Return MyBase.GetPreferredSize(proposedSize)

    End Function
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Software Developer
Poland Poland
I am a graduate of Wroclaw University of Science and Technology, Poland.

My interests: gardening, reading, programming, drawing, Japan, Spain.

Comments and Discussions