开发者

opacity around the message

开发者 https://www.devze.com 2023-02-21 20:07 出处:网络
Is it possible to make a poup screen with high opacity around the popup screen in winform? If yes, how?

Is it possible to make a poup screen with high opacity around the popup screen in winform? If yes, how?

How do I开发者_如何转开发 make the pop up message or GUI screen to be in the middle of the computer screen?

Please remember that I don't have any source code yet.

An example:

opacity around the message


To show your Form at center of screen, use StartPosition property of form to CenterScreen.

this.StartPosition = FormStartPosition.CenterScreen; 


Now, to grey rest of the portion of screen.

Take a new form name it frmBlur and set these properties.

this.BackColor = SystemColors.ControlDark;            
this.FormBorderStyle = FormBorderStyle.None;            
this.Opacity = 0.8;
this.ShowInTaskbar = false;  
this.TopMost = true;
this.WindowState = FormWindowState.Maximized;      

Now, use the below code to display MessageBox or winform

private void button1_Click(object sender, EventArgs e)
    {
        using (frmBlur ob = new frmBlur())
        {
            ob.Show();
            frmMessage f = new frmMessage();
            f.TopMost = true;
            f.ShowDialog();
        }
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号