VB.Net .Clear() or txtbox.Text = “” textbox clear methods

后端 未结 8 851
囚心锁ツ
囚心锁ツ 2021-01-11 13:49

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 diff

8条回答
  •  无人及你
    2021-01-11 14:36

    The Clear method is defined as

        public void Clear() { 
            Text = null;
        } 
    

    The Text property's setter starts with

            set { 
                if (value == null) { 
                    value = "";
                } 
    

    I assume this answers your question.

提交回复
热议问题