且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MDI问题(父子窗体)

更新时间:2023-12-06 08:29:46

我能给您的***建议:永远不要使用MDI!

在CodeProject上已多次给出此建议.
似乎没有人对此设计感到满意;这是非常不方便的.我不知道使用它的单个像样的或仅由专业编写的应用程序.

有很多更好的选项,例如单窗口选项卡式界面.

—SA
The best advice I can give you: never use MDI!

This recommendation was given many times on CodeProject.
It looks like no one is happy with this design; it is extremely inconvenient. I don''t know a single decent or just professionally written application which uses it.

There are many much better options, such as single-window tabbed interface.

—SA


在第一种情况下(Button3_Click),我不清楚我指的是什么.是主要形式的孩子(frmmain)的孩子吗?

您可以添加我在每个实例中所指的内容吗?这可能会清除一些问题.

无论哪种方式,您都关闭了我,所以如果Me.Uptable与您关闭的我相同,那么您将遇到问题.

如果这些是MDI表单,则只需要隐藏主要表单,而不是子表单.反之亦然...如果隐藏主窗体,则除非同时显示父窗体,否则显示子窗体不会显示它.

出于好奇...除了男性和女性之外,性别还有别的选择吗?我希望这可能是空白...

如果我是您,我会考虑使用ExecuteScalar而不是填写表格.您可以编写SQL来返回Count,然后使用ExecuteScalar,您不必创建表或DataAdapter.
I''m not clear what Me is referring to in the first case (Button3_Click). Is it a child of a child of a main form (frmmain)?

Can you add what Me refers to in each instance? That may clear some things up.

Either way, you closed Me, so if Me.Uptable is the same Me that you closed, you''re going to have problems.

And if these are MDI forms, you just need to hide the main form, not the children forms. The reverse is also true...if you hide the main form, showing a child form won''t show it unless you show the parent form as well.

As a curiosity...is there an option for gender besides male and female? I hope that means it could be blank...

And if I were you, I would look into using ExecuteScalar instead of filling a table. You can write your SQL to return a Count and then using ExecuteScalar you wouldn''t have to create a table or DataAdapter.


威廉,

此处的 me 是指Frmquestionnaire(单击跳过"按钮= Button3时)


对于此代码:-

Hi William,

The me there refer to Frmquestionnaire (Upon clicking SKIP button = Button3)


For this codes:-

Me.Close()
      Me.Hide()  
      frmmain.pmain.Hide()
      frmmain.Hide()



好的,我明白您的意思.

出于好奇...除了男性和女性外,性别还有别的选择吗?我希望这可能是空白...

对于这个,因为我不知道要放什么,所以我只想测试一个条件.请忍受我,因为我的编程不好.很抱歉给我带来麻烦

ExecuteScalar?我完全不知道那是什么,但是我会得到一些信息.

问题:

我遇到了问题,当我单击跳过"按钮(按钮3)时,它将把程序带到系统托盘.然后,我双击系统任务栏中的图标(上面的代码),它将显示frmQuestionnaire.Show().
但是,表格并不相应. (frmQuestionnaire不在frmmain界面的框架内.

图像如下所示:- http://cid-77fe20fabddbcb9e.photos.live .com/self.aspx/New%20album/wmYaCnWb.jpg [ ^ ]

我希望能从任何人那里得到一些建议.

非常感谢.



Ok I understand what you mean here.

As a curiosity...is there an option for gender besides male and female? I hope that means it could be blank...

For this one, Because I have no idea what to put so I just test to make a condition. Please bear with me as Im not good in programming . I am sorry for that trouble

ExecuteScalar? I am totally no idea what is that but I will get some info.

Problem:

I am facing problem, When I click skip button (Button 3) it will bring the program to system tray. Then I double click icon in system tray(Codes as above) it will show frmQuestionnaire.Show().
However the form is not accordingly. (The frmQuestionnaire is not in the frame within frmmain interface.

The image as shown here :- http://cid-77fe20fabddbcb9e.photos.live.com/self.aspx/New%20album/wmYaCnWb.jpg[^]

I hope to get some advise from anyone.

Thank so much.