• Log in or sign up for an account here: https://www.sythe.org/login

How To Make A "ClearPad"

Dark L3g3nd

Active Member
Joined
Mar 9, 2010
Sythe Gold
0
Messages
157
What is a clearpad?​

A program with a text box and a button that clears the textbox.

What is it used for?
Well i use it for video tutorials as you can give instructions and clear with one click.

Requirements
Microsoft Visual C# 2008 Edition Download Here



Step 1
File>New Project>Windows Form Application>Name>Name It Whatever u want.

Step 2: Building the GUI
A toolbox will now pop-up look for "button" then drag two on to the design.
And click on button1 and on the right hand side bottom corner look for "Text"
You should see button1 rename it to Quit then do the same for button2 and rename it Clear. then drag in a richtextbox from the toolbox and re-size it to how big you want it to be.

Step 4
Double click our Quit button and you will see
Code:
private void button1_Click(object sender, EventArgs e)
{

}
So now we want to make this our Quit button so we make the code look like this

Code:
 private void button1_Click(object sender, EventArgs e)
{
this.Close(); // Closes the Application
}

Step 5
Double click our Clear button and you will see
Code:
private void button2_Click(object sender, EventArgs e)
{

}

So we want to make this our clear button so we make the code look like this:
Code:
private void button2_Click(object sender, EventArgs e)
{
richTextBox1.ResetText(); // Clears all the text in richtextbox1

}

Step 6
Now Save All. Then Build> Build Solution. Then go into where you saved it then Bin>Release>Clearpad.exe


Our Final Code
Or final code should look like this:
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ClearPad
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }   

        private void button1_Click(object sender, EventArgs e)
        {
             this.Quit
        }

        private void button2_Click(object sender, EventArgs e)
        {
              richTextBox1.ResetText();
        }
    }
}

​
 
Runescape Gamblingrunescape gambling
Back
Top