T
tommaso.gastaldi
I found useful to use transparent controls like:
'----------------------------------------------------------------------------------
Public Class UserControlTransp
Inherits System.Windows.Forms.UserControl
#Region " Windows Form Designer generated code "
....
#End Region
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim MyParams As CreateParams = MyBase.CreateParams()
MyParams.ExStyle = MyParams.ExStyle Or &H20
Return MyParams
End Get
End Property
Protected Overrides Sub OnPaintBackground(ByVal e As
System.Windows.Forms.PaintEventArgs)
' for transparency
End Sub
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
' Any drawing here ...
ControlPaint.DrawBorder3D(e.Graphics, New Rectangle(10, 10,
200, 100), Border3DStyle.Etched)
e.Graphics.FillEllipse(New SolidBrush(Color.FromArgb(100, 120,
200, 255)), New Rectangle(30, 30, 100, 100))
End Sub
End Class
'----------------------------------------------------------------------------------
this allows to draw on a trasparent control surface anything you want.
Does anybody know the corresponding instructions to do the same with a
Form?
(clearly this is different by setting the form opacity, and allows for
instance to draw sharp
pictures on a transparent surface: opacity would instead be inherited
by images drawn on the form).
-tom
'----------------------------------------------------------------------------------
Public Class UserControlTransp
Inherits System.Windows.Forms.UserControl
#Region " Windows Form Designer generated code "
....
#End Region
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim MyParams As CreateParams = MyBase.CreateParams()
MyParams.ExStyle = MyParams.ExStyle Or &H20
Return MyParams
End Get
End Property
Protected Overrides Sub OnPaintBackground(ByVal e As
System.Windows.Forms.PaintEventArgs)
' for transparency
End Sub
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
' Any drawing here ...
ControlPaint.DrawBorder3D(e.Graphics, New Rectangle(10, 10,
200, 100), Border3DStyle.Etched)
e.Graphics.FillEllipse(New SolidBrush(Color.FromArgb(100, 120,
200, 255)), New Rectangle(30, 30, 100, 100))
End Sub
End Class
'----------------------------------------------------------------------------------
this allows to draw on a trasparent control surface anything you want.
Does anybody know the corresponding instructions to do the same with a
Form?
(clearly this is different by setting the form opacity, and allows for
instance to draw sharp
pictures on a transparent surface: opacity would instead be inherited
by images drawn on the form).
-tom