Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Transparent UserControl

Protected Overrides ReadOnly Property CreateParams() As CreateParams
    Get
        ' Make background transparent
        Dim cp As CreateParams = MyBase.CreateParams
        cp.ExStyle = cp.ExStyle Or &H20
        Return cp
    End Get
End Property

Protected Overrides Sub OnPaintBackground(e As PaintEventArgs)
    '' call MyBase.OnPaintBackground(e) only if the backColor is not Color.Transparent
    If Me.BackColor <> Color.Transparent Then
        MyBase.OnPaintBackground(e)
    End If
End Sub
Comment

c# UserControl make background transparent

public partial class UCTransparent : UserControl
     {

         public UCTransparent()
         {
                InitializeComponent(); 
         }
         protected override CreateParams CreateParams
         {
                get
                {
                       CreateParams cp = base.CreateParams;
                       cp.ExStyle |= 0x20;
                       return cp;
                }
         }

         protected override void OnPaintBackground(PaintEventArgs e)
         {
             base.OnPaintBackground(e);
         }
      }
Comment

PREVIOUS NEXT
Code Example
Csharp :: autho close in persian time picker 
Csharp :: .net core 3 entity framework constraint code first image field 
Csharp :: conditional middleware .net core 
Csharp :: how to change font text mesh pro 
Csharp :: mvc dotnet core how does the view pass parameters to controler 
Csharp :: asp:button onclick not respond 
Csharp :: overloading constructors c# 
Csharp :: whining 
Csharp :: Alll select options unselectable 
Csharp :: générer un nombre aléatoire en c# 
Csharp :: wpf loop through grid rows 
Csharp :: fluent api c# hasmany withmany 
Csharp :: finding holydays asp.net 
Csharp :: take the last 50 from array c# 
Csharp :: how to create an initialized jtoken c# 
Csharp :: c# expandoobject indexer 
Csharp :: how to make a destroy reference in unity 
Csharp :: c# read csv file save to database dynamically 
Csharp :: Debug output to console and a log 
Csharp :: "??" in C# 
Csharp :: search list for words c# 
Csharp :: google sheets problems cell not considered even 
Csharp :: c# variables 
Csharp :: get picked item xamarin 
Csharp :: c# print 1 to 100 
Csharp :: unity get refresh rate 
Csharp :: .net mvc foreach with index 
Csharp :: Handling aggregation responses with NEST c# 
Csharp :: Filter list contents with predicate (Lambda) 
Csharp :: xml reader attributes 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =