简体   繁体   中英

How to make child Form transparent?

Am creating a windows application (win form). I want to create a UI something like the attached image.

Am using a form ( called CalendarForm ),that will contains the right side controls (blue background portion)

The issue now am facing is, when am using MDI and setting CalendarForm as a child. Then I am not able to sent the opacity to show the MDI parent form background.

Am using below mentioned code in MDIForm_Load method

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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