Skip to content

Instantly share code, notes, and snippets.

@facebookegypt
Last active December 29, 2015 09:29
Show Gist options
  • Select an option

  • Save facebookegypt/7650439 to your computer and use it in GitHub Desktop.

Select an option

Save facebookegypt/7650439 to your computer and use it in GitHub Desktop.
'Visual Basic Online Course
'VB6 Create Rounded and Transparent Form
'FrmShapedForm Code
Option Explicit
Dim mChildFormRegion As Long
Private Sub Form_Load()
Dim i
Me.WindowState = vbNormal
Me.Text1.Text = "A demonstration of a shaped" & vbCrLf & _
"form. Unlike transparent form," & vbCrLf & _
"you can now drag on the visible" & vbCrLf & _
"parts of the shaped form."
If mShape = 0 Then
mChildFormRegion = CreateRoundRectRgn(0, 0, Me.Width / xp, Me.Height / yp, 40, 40)
ElseIf mShape = 1 Then
mChildFormRegion = CreateEllipticRgn(0, 0, Me.Width / xp, Me.Height / yp)
Else
i = (Me.Width / xp - Me.Height / yp) / 2
mChildFormRegion = CreateEllipticRgn(i, 0, i + Me.Height / xp, Me.Height / yp)
End If
SetWindowRgn Me.hwnd, mChildFormRegion, False
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment