VB.Net .Clear()或txtbox.Text = QUOT;"文本清晰方法文本、清晰、方法、Clear

2023-09-05 02:07:15 作者:雨落伊人

不远处成编程和刚刚加入威猛公司的这个论坛,所以这是一个愚蠢的问题,但什么是清除文本框在VB.Net最好的方式,什么是两种方法之间的区别是什么?我也看到有人用自己的形式明确的目标,我可以看到为什么,但在这种情况下,我只学习是至关重要的民俗。

Not far into programming and just joined this forum of mighty company so this is a silly question, but what is the best way to clear textboxes in VB.Net and what is the difference between the two methods? I have also seen people be critical of folk using clear objects on their forms and I can see why but in this case, I am only learning.

txtbox1.Clear()

txtbox1.Text = ""

任何帮助是非常AP preciated。

Any help is much appreciated.

推荐答案

我不知道为什么微软认为有必要包括这个额外的方法(因为它的似乎的做没有什么特别的) - 但因为它的存在,我建议使用它。

I’m not sure why Microsoft felt the need to include this extra method (since it seems to do nothing special) – but since it’s there, I recommend using it.