问题描述
在我的项目中,有两种形式。从第一个(或主要)表单,我使用下面的代码显示第二个:
formViewData frmViewData = new formViewData(iCase,m_dt [iCase],m_dt [iCase]);
frmViewData.Show();
frmViewData.BringToFront();
但是,第二个仍然落后于第一个。什么是解决它的正确方法?
除此之外我还尝试了另一种方法,即隐藏第一种形式
此跨度> .Hide(); // 或this.Visible = false;
但是,当我关闭第二个表单时,我无法使用该代码打开第一个表单。
View.uxMain.Show(); // 错误:非静态字段,方法或属性需要对象引用...
解决这个问题的正确方法是什么?谢谢,如果你能分享你的经验。
我尝试过:
未成功将活动表单置于最前面或重新显示隐藏表单
In my project, there are 2 forms. From the 1st (or main) form, I use the code below to show the 2nd one:
formViewData frmViewData = new formViewData(iCase, m_dt[iCase], m_dt[iCase]);
frmViewData.Show();
frmViewData.BringToFront();
However, the 2nd one is still behind the 1st one. What's the proper way to solve it?
Besides I also tried another way, namely hide the 1st form by
this.Hide(); // or this.Visible = false;
However, when I close the 2nd form, I could not use the code to open the 1st form.
View.uxMain.Show(); // Error: An object reference is required for the non-static field, method, or properties ...
What's the proper way to solve this problem? Thanks if you can share your experience.
What I have tried:
Not successful to bring a active form to front or re-show a hidden form
这篇关于未成功将活动表单置于前面或重新显示隐藏表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!