Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom controls (groupbox, picturebox, label) - On Mouse Enter, Insides Disappear
    primarykey
    data
    text
    <p>Sorry for that very confusing title, here's my problem. I have a custom GroupBox, and inside of that is a custom picturebox and label.</p> <p>The issue is, when I launch the form application whenever my mouse enters the GroupBox my my label's font color changes to black and my picture box seems to have "disappeared". I don't have a clue why that is.</p> <p>GroupBox:</p> <pre><code>Class GhostGroupBox Inherits ThemeControl154 Sub New() MyBase.New() SetStyle(ControlStyles.ResizeRedraw, True) SetStyle(ControlStyles.ContainerControl, True) DoubleBuffered = True BackColor = Color.Transparent End Sub Protected Overrides Sub ColorHook() End Sub Protected Overrides Sub PaintHook() G.Clear(Color.FromArgb(60, 60, 60)) Dim asdf As HatchBrush asdf = New HatchBrush(HatchStyle.DarkDownwardDiagonal, Color.FromArgb(35, Color.Black), Color.FromArgb(0, Color.Gray)) G.FillRectangle(New SolidBrush(Color.FromArgb(60, 60, 60)), New Rectangle(0, 0, Width, Height)) asdf = New HatchBrush(HatchStyle.LightDownwardDiagonal, Color.DimGray) G.FillRectangle(asdf, 0, 0, Width, Height) G.FillRectangle(New SolidBrush(Color.FromArgb(230, 20, 20, 20)), 0, 0, Width, Height) G.FillRectangle(New SolidBrush(Color.FromArgb(70, Color.Black)), 1, 1, Width - 2, Me.CreateGraphics.MeasureString(Text, Font).Height + 8) G.DrawLine(New Pen(Color.FromArgb(90, 90, 90)), 1, Me.CreateGraphics.MeasureString(Text, Font).Height + 8, Width - 2, Me.CreateGraphics.MeasureString(Text, Font).Height + 8) DrawBorders(Pens.Black) DrawBorders(New Pen(Color.FromArgb(90, 90, 90)), 1) G.DrawString(Text, Font, Brushes.White, 5, 5) End Sub End Class </code></pre> <p>Label &amp; PictureBox (same code, just inherits the respective):</p> <pre><code>Public Class TransparentLabel Inherits Label Public Sub New() Me.SetStyle(ControlStyles.Opaque, True) Me.SetStyle(ControlStyles.OptimizedDoubleBuffer, False) End Sub Protected Overrides ReadOnly Property CreateParams() As CreateParams Get Dim parms As CreateParams = MyBase.CreateParams parms.ExStyle = parms.ExStyle Or &amp;H20 ' Turn on WS_EX_TRANSPARENT Return parms End Get End Property End Class </code></pre> <p>Can someone see what's wrong? I tried commenting out the ControlBox's OnMouseMove, that didn't fix it. I also don't have any events set for the ControlBox.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload