ADP.NET C#编程需要帮助 [英] ADP.NET C# Programming need a help

查看:100
本文介绍了ADP.NET C#编程需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Guy's

我需要一个帮助,很容易让人解决它

我正在制作桌面应用程序。在那里我采取这样的形式



Hello Guy''s
I Need a help it is easy to right person to solve it
I''m make desktop application. there i take a some form like this

Form1 = Ismdicontainer = True
Form2 = Ismdicontainer = False





我是开放的Form1中的Form2正在工作

但是我想打开一些类似的形式





I am open a Form2 in Form1 that is working
but I want to open some form something like that

Form1 = Ismdicontainer = True
Form2 = Ismdicontainer = False
Form3 = Ismdicontainer = False





现在我想在用户点击时打开Form1中的Form3来自Form2的按钮



Form1设置为Ismdicontainer = Talse



它是父类功能。



感谢希望任何人尽快帮助我..

等待示例代码,这有助于打开这样的表格



谢谢



Now i want to open Form3 in Form1 butt when user click on button which is in from Form2

Form1 setting is Ismdicontainer = Talse

its is parent class function.

Thanks hope any ones help me soon..
waiting for sample code which help to open Form like this

Thank You

推荐答案

这很简单,但最好不要按照你的想法去做。

因为Form1是Form2和Form3,它应该是唯一可以解决它们的形式 - 否则,所有三种形式的设计都被锁定在一起,并且维护它们变得更加困难。



所以你要做的是在Form2中创建一个事件(称之为ShowDetailsRequest或类似的),它在Form1中处理。事件处理程序比通过公共属性从Form2获取所需信息后打开Form3(或者不是,如果它有不同的方式来显示信息)。

这很容易做到:有一个在这里查看添加活动的简单代码片段 [ ^ ] - 您需要的代码位于Tip的顶部,其余部分仅描述了如何更容易地创建它们。
That is fairly simple to do, but it''s best not to do it in the way you think.
Because Form1 is the parent of both Form2 and Form3, it should be the only form which konws about them both - otherwise, the design of all three forms is locked together, and it becomes a lot harder to maintain them.

So what you do is to create an event in Form2 (call it ShowDetailsRequest or similar) which is Handled in Form1. The event handler than opens Form3 (or not, if it has a different way to display the information) after getting what information it needs from Form2 via public properties.
This is really easy to do: have a look here A simple code snippet to add an event[^] - the code you need is in the top of the Tip, the rest just describes how to make it easier to create them.


这篇关于ADP.NET C#编程需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆