如何从表单中的输入框中清除文本 [英] How to clear the text from input boxes in a form

查看:85
本文介绍了如何从表单中的输入框中清除文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我想知道如何从设计的layoutcontrol输入项(TextEdit,Comboedit)中清除文本。我知道我可以单独清除ex:textbox1.Text =;或textbox1.Text = String.Empty;。但是还有另一种方法可以在一行中清除文本。

Hi
I want to know how to clear a text from designed layoutcontrol input items(TextEdit,Comboedit). i know i can clear individually for ex: textbox1.Text=""; or textbox1.Text=String.Empty;. but is there anyother way to clear the text in a single line.

推荐答案

创建一个方法,在你自己的问题中,如上所述清空所有用户控件设置,然后在提交按钮中调用该方法(操作表单的按钮。)





问候,

:)
Create a method in which empty all the user controls as u mentioned above in your own question by setting up " " and than call that method in your submit button (button which is manipulating your form.)


Regards,
:)




i得到另一个解决方案



Hi ,
i got another one solution

foreach (Control ctl in this.layoutControl1.Controls)
           {
               if (ctl is DevExpress.XtraEditors.TextEdit) ctl.Text = string.Empty;
               if (ctl is DevExpress.XtraEditors.ComboBoxEdit) ctl.Text = string.Empty;

           }


这篇关于如何从表单中的输入框中清除文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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