Hi guys. I'm stuck. How can I use a custom color (rgb 25, 25, 25)(for example) as my fill rectangle color instead of the default blue?
'Private Sub ListBox10_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles ListBox10.DrawItem
' If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
' e.Graphics.FillRectangle(Color.??, e.Bounds)
' End If
' Using b As New SolidBrush(e.ForeColor)
' e.Graphics.DrawString(ListBox10.GetItemText(ListBox10.Items(e.Index)), e.Font, b, e.Bounds)
' End Using
FillRectangle expects a Brush not a Color, but if you instantiate a Brush derivative(i.e. SolidBrush), you can set the color property using the Color.FromARGB overload that accepts just the RGB values and assume and Alpaha value of 255 (fully opaque).
Private Sub ListBox10_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles ListBox10.DrawItem
Dim mybrush As System.Drawing.SolidBrush
mybrush.Color = Color.FromArgb(25, 25, 25)
If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
Using b As New SolidBrush(e.ForeColor)
e.Graphics.DrawString(ListBox10.GetItemText(ListBox10.Items(e.Index)), e.Font, b, e.Bounds)
Not all colors have a name. With all the combinations of 255,255,255 integers you can form more than 1,5 million colors. There is however an enumeration that lists all the colors that have a name Click Here
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...