I need help in programming in c# (Microsoft Visual Studio C# 2010 Express) I need to be able to write a second degree function in a textbox and then when I click enter it draws the graph in a coordinatesystem for me. With other words I need to create a graph/parabola drawer for whatever second degree function I choose.
So far I have managed to make a first degree function drawer, I just have no idea how to make one for a second degree function.
Here are the codes for the first degree function drawer:
namespace Graph drawer
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    int K;
    int Ystart;
    int Yend;
    int Y1;
    protected override void OnPaint(PaintEventArgs e)
    {
        Graphics g = e.Graphics;
        Pen p=new Pen(Color.Black);
        g.DrawLine(p, 100, 250, 400, 250);
        g.DrawLine(p, 250, 100, 250, 400);
        g.DrawLine(p, 100, Ystart, 400, Yend);
    }
    private void btnDraw_Click(object sender, EventArgs e)
    {
        K = int.Parse(tbxFirstX.Text);
        int m = int.Parse(tbxM.Text);
        Ystart = 250 - 10 * m + K * 150;
        Yend = 250 - 10 * m - K * 150;
        Invalidate(); 
    }
