Jump to content

  •  

  • iBotModz CBox


    Photo

    (C#)Clear Items


    This topic has been archived. This means that you cannot reply to this topic.
    1 reply to this topic

    #1 Lakar

    Lakar

      Private

    • Members+

    • 42 posts
    • Joined: 01-November 08

    Posted 11 May 2009 - 10:42 PM

    (C#)Clear Items

    This is how you would clear, let's use as an example, a textbox. This is mainly used when you are closing a program, and want all data to be cleared in those text boxes.


    this.textBox1.Clear();

    All you have to do to use this for other objects is change textbox to the item you want to clear. For example "this.picturebox1.Clear();".

    Enjoy

    -Lakar

    #2 Dark Slipstream

    Dark Slipstream

      Blue Shadowz Owner

    • Members+

    • 2,829 posts
    • Joined: 19-April 08

    Posted 12 May 2009 - 08:37 AM

    You can also use:

    this.textBox1.Text = Nothing;
    
    'or
    
    this.textBox1.Text = "";

    and in VB.NET:

    TextBox1.Text.Clear()
    
    'or
    
    TextBox1.Text = Nothing
    
    'or
    
    TextBox1.Text = ""