Drop Shadow

How can I add a drop shadow to my form in VB.Net 2005?
[54 byte] By [robinjam] at [2007-12-28]
# 1
bump
robinjam at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

Public Class Form1

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

Dim x As Single = 110.0F

Dim y As Single = 120.0F

Dim strText As String = "Shadow Text"

Dim drawFont As Font = New Font("Comic Sans MS", 24, FontStyle.Bold)

Dim drawBrush As SolidBrush = New SolidBrush(Color.DodgerBlue)

Dim drawShadow As SolidBrush = New SolidBrush(Color.DimGray)

Dim drawFormat As StringFormat = New StringFormat()

e.Graphics.DrawString(strText, drawFont, drawShadow, x + 3, y + 3, drawFormat)

e.Graphics.DrawString(strText, drawFont, drawBrush, x, y, drawFormat)

End Sub

End Class

TallDude at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
Thanks, but I wanted to add a drop shadow to the form, not to text on the form.
Any other ideas?
robinjam at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4

Worked it out:

Public CS_DROPSHADOW As Int32 = &H20000

Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams

Get

Dim parameters As CreateParams = MyBase.CreateParams

parameters.ClassStyle += CS_DROPSHADOW

Return parameters

End Get

End Property

robinjam at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...