|
-
Aug 6th, 2004, 01:19 PM
#1
Thread Starter
Lively Member
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 
-
Aug 6th, 2004, 01:43 PM
#2
Frenzied Member
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.
-
Aug 6th, 2004, 02:37 PM
#3
Frenzied Member
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:
Shared Sub Main()
Application.EnableVisualStyles()
Application.Run(New Form1)
End Sub
3) Change buttons and anything else that has the FlatStyle property to System rather than the default of Standard.
Mike
-
Aug 6th, 2004, 02:58 PM
#4
Hyperactive Member
VB2005 does it automatically
My monkey wearing the fedora points and laughs at you.
-
Aug 6th, 2004, 03:58 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|