打印另一种形式的textbox.text [英] print textbox.text of another form

查看:96
本文介绍了打印另一种形式的textbox.text的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

请帮助我,我在c#.net中遇到问题
我有3种表单,其中1种是在Form1中的文本框,1种是在Form2中的文本框.
在form3中:我想要一个打印按钮以在form1和form2中打印文本框的文本

请帮助我,我是C#的新手,非常感谢您解释您的答案.

hello every body

Please help me please i have problem in c#.net
I have 3 forms,1 textbox in form1,1 textbox in form2.
in form3: I want to have a print button to print the text of textboxes in form1 & form2

please help me I''m new in C# please explain your answer thanks a lot.

推荐答案

您应该使用委托来查询其他表格的内容他们的文本框. Google委托并阅读了有关该主题的文章,如果您是C#的新手,它可能比您想要的复杂得多,并且论坛答案也不会减少.
You should use delegates to be able to query your other forms for the contents of their textboxes. Google delegates and read some articles on the topic, if you''re new to C#, it''s probably more complex than you''d like, and a forum answer won''t cut it.


U可以使用公用函数,该公用函数以form1返回字符串

然后在Form2中
字符串Form1text =(GetForm1Window()as form1).functionName();
U can use a public function which returns string in form1

then in Form2
string Form1text = (GetForm1Window() as form1).functionName();


这篇关于打印另一种形式的textbox.text的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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