Home of Gamehacking - Archiv
Form Abrunden VB 2008 - Druckversion

+- Home of Gamehacking - Archiv (http://archiv-homeofgamehacking.de)
+-- Forum: Coding (http://archiv-homeofgamehacking.de/forumdisplay.php?fid=15)
+--- Forum: Visual Basic 6, VB.NET (http://archiv-homeofgamehacking.de/forumdisplay.php?fid=19)
+--- Thema: Form Abrunden VB 2008 (/showthread.php?tid=66)



Form Abrunden VB 2008 - DNA - 28.08.2010

Hi,

um die Ecken einer Form abzurunden braucht man folgendes...

Die Funktion

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
    Sub abrunden(ByVal was As Object, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal radius As Integer)
        Dim gp As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath()
        gp.AddLine(x + radius, y, x + width - radius, y)
        gp.AddArc(x + width - radius, y, radius, radius, 270, 90)
        gp.AddLine(x + width, y + radius, x + width, y + height - radius)
        gp.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90)
        gp.AddLine(x + width - radius, y + height, x + radius, y + height)
        gp.AddArc(x, y + height - radius, radius, radius, 90, 90)
        gp.AddLine(x, y + height - radius, x, y + radius)
        gp.AddArc(x, y, radius, radius, 180, 90)
        gp.CloseFigure()
        was.region = New System.Drawing.Region(gp)
        gp.Dispose()
    End Sub


Folgendes in Form_Load

Code:
abrunden(Me, 0, 0, Me.Width, Me.Height, 20)


Das wars auch schon Wink


~DNA


RE: Form Abrunden VB 2008 - chesar - 12.09.2010

Cool danke sieht Super aus Smiling

aber wie kann ich jetzt meine Form verschieben? so wie bei euch wenn man auf der Form klickt egal wo und hält die Maustaste fest kann man die Form ja immer noch verschieben.