hadinatayp
Well-known member
- Joined
- Feb 8, 2006
- Messages
- 95
- Programming Experience
- Beginner
Does anybody know how to make control transparant like this in vb.net?
thx
thx
Control.BackColor = Color.FromARGB(Amount of transparency, R,G,B)
Mybase.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
Public Class CustomListBox
Inherits ListBox
Public Sub New()
MyBase.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
End Sub
End Class
Public Class CustomListBox
Inherits ListControl
Protected Overrides Sub Refre****em(ByVal index As Integer)
End Sub
Public Overrides Property SelectedIndex() As Integer
Get
End Get
Set(ByVal value As Integer)
End Set
End Property
Protected Overrides Sub SetItemsCore(ByVal items As System.Collections.IList)
End Sub
End Class
Me.SetStyle(ControlStyles.DoubleBuffer _
Or ControlStyles.UserPaint _
Or ControlStyles.AllPaintingInWmPaint _
Or ControlStyles.SupportsTransparentBackColor, _
True)
Private Sub ChildItem_MouseEnter(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.MouseEnter
Me.BackColor = Color.FromArgb(150, Color.Yellow)
End Sub
Private Sub ChildItem_MouseLeave(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.MouseLeave
'the selected property already sets the BackColor based
' on whether or not the item is selected so use it:
Me.Selected = Me.Selected
End Sub