本文介绍了在C#中显示新窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用代码动态创建表单,并向其添加用户控件,而不是显示表单
如果我将背景图像添加到带有拉伸到backgroundimagelayout的用户控件中,则在完全加载后,如果我不放置任何内容,窗体将闪烁,它不会执行任何操作并正确加载.


有谁知道如何解决它,我想使图像大小与屏幕大小相同,但这不是一个好方法.

i create a form dynamically in code and add a user control to it than i show the form
if i add a background image to the user control with stretch to the backgroundimagelayout the form will flashes after complete loading if i put none it does nothing and load correctly.


does anyone know how to solve it, i am looking to make the image size same as the screen size but it is not good way.

Form f = new Form();
f.Size = SystemInformation.VirtualScreen.Size;
uc.Dock = DockStyle.Fill;
f.Controls.Add(uc);
f.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
f.TopMost = true;
f.Show();




感谢您的帮助.




thanks for anyhelp

推荐答案


这篇关于在C#中显示新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 15:56
查看更多