简体   繁体   English

如何使子窗体透明?

[英]How to make child Form transparent?

Am creating a windows application (win form). 我正在创建Windows应用程序(Win窗体)。 I want to create a UI something like the attached image. 我想创建一个类似于附件图像的UI。

Am using a form ( called CalendarForm ),that will contains the right side controls (blue background portion) 我正在使用一个表单( 称为CalendarForm ),该表单将包含右侧控件(蓝色背景部分)

The issue now am facing is, when am using MDI and setting CalendarForm as a child. 现在面临的问题是,当使用MDI并将CalendarForm设置为子级时。 Then I am not able to sent the opacity to show the MDI parent form background. 然后,我无法发送不透明度以显示MDI父表单背景。

Am using below mentioned code in MDIForm_Load method 我在MDIForm_Load方法中使用下面提到的代码

this.WindowState = FormWindowState.Maximized;
CalendarForm calForm = new CalendarForm();
calForm.BackColor = Color.FromArgb(33, 66, 131);
calForm.Opacity = 0.5d;
calForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
calForm.MdiParent = this;           
calForm.Show();

Is there any way to achieve my requirement ? 有什么办法可以达到我的要求? 在此处输入图片说明

使用Patrik Bohman创建的“ 自定义月份日历” ,我们可以使日历背景透明。

要使WinForm透明,可以使用opacity属性

calForm.Opacity = 0.5;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM