Results 1 to 5 of 5

Thread: XP look an feel [Resolved]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    127

    Question XP look an feel [Resolved]

    Two part question:

    1. Is there an easy way in vb.net 2002 to make the rounded corners "XP Style" on a panel
    without going thru all the trouble of using 3rd party add on's?


    2. This code lets you move "slide" a panel but it will let you pull it all the way off the
    forms edge or all the way back into itself and either case it disapears.
    It needs to have a way to set a limit like a form has MaximumSize and MinimumSize
    type limits. Any thoughts on an easy way to get this to work?

    Maybe like if the panel is moved to a certian point that it stops
    moving or something.

    Code:
    Dim _mouseDown As Boolean = False
    
    
        Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove
    
            If _mouseDown = True Then
                Panel1.Width = e.X
            Else
                If e.X >= Panel1.Width - 3 Then
                    Panel1.Cursor = Cursors.VSplit
                Else
                    Panel1.Cursor = Me.Cursor
                End If
            End If
    
        End Sub
    
        Private Sub Panel1_MouseDown(ByVal sender As Object, _
        ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
    
            _mouseDown = True
            Panel1.Cursor = Cursors.VSplit
        End Sub
    
        Private Sub Panel1_MouseUp(ByVal sender As Object, _
        ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp
    
            _mouseDown = False
            Panel1.Cursor = Me.Cursor
        End Sub
    Last edited by teamdad; Aug 17th, 2004 at 09:34 PM.
    using: VB.Net 2005

  2. #2
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    In the 2003 version, you can enable visualStyles but I personally have had no luck with that. That is done in the initialization of the form.

    there is a FREE 3rd party control if you were trying to not spend money.

    check this thread out: http://www.vbforums.com/showthread.p...ghlight=visual

    it works GOOD.

  3. #3
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    Andy,

    What do you mean no luck with that? This seems to work for me:

    1) Change properties of your project to have Starup Object be Sub Main rather than Form1
    2) Add this code
    VB Code:
    1. Shared Sub Main()
    2.         Application.EnableVisualStyles()
    3.         Application.Run(New Form1)
    4.     End Sub
    3) Change buttons and anything else that has the FlatStyle property to System rather than the default of Standard.

    Mike

  4. #4
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423
    VB2005 does it automatically
    My monkey wearing the fedora points and laughs at you.

  5. #5
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Originally posted by Arrow_Raider
    VB2005 does it automatically
    Great then...Let's all stop programming while we wait


    Seriously though. Just use Skybound Visual styles.
    It's just a matter of adding a reference to the DLL, and you can use the EnableVisualStyles.

    A few controls aren't affected by this. In that case, you just add their component to the form.

    No code needed except the "Enable" part in Sub Main.

    http://www.skybound.ca/developer/vis...s/default.aspx

    And the best part: IT'S ABSOLUTELY FREE. Both personal and commercial use.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

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