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 :: how to count specific controls in a container c# 
Csharp :: publish applications for linux 
Csharp :: downloading a large file asp boilerplate (abp) 
Csharp :: poems 
Csharp :: unity variable in editor limit value 
Csharp :: Valid date check with DateTime.TryParse method 
Csharp :: WixSharp-FirewallException 
Csharp :: c# textbox tab column 
Csharp :: there is no renderer attached to the gameobject 
Csharp :: remove lines from textfile 
Csharp :: c# xaml textblock new line 
Csharp :: init stirng list c# 
Csharp :: check the request comes from which operating system used by user in asp net core 
Csharp :: c# office interop copy slide to another pppt 
Csharp :: linq pick random element 
Csharp :: commandline to open outlook minimized 
Csharp :: universities in greece 
Csharp :: set main camera unity 
Csharp :: .net 6 get appsettings value 
Csharp :: rating iOS game in unity 
Csharp :: c# use enum in class 
Csharp :: unity destroy gameobject with delay 
Csharp :: hydrogen fuels 
Csharp :: how crate cron netapp 
Csharp :: git set origin 
Html :: html5 template 
Html :: html input regex only numbers 
Html :: how to run vscode as root 
Html :: fa fa globe 
Html :: accepts audio html 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =