Convert.ToInt32 error

Well I have this script which works fine but the problem is that I cant write in GUI.TextField. mean that I cant edit the value to convert that new value into int. When ever I try to write in the TextField I get error.
FormatException : Input string was not in the correct format.

here is My Script…

using System;

void OnGUI()
{
Convert.ToInt32(GUI.TextField(new Rect(150,80,30,20),"0", 25));
}

I suggest reading this documentation then running the following code and checking the console to see what the contents of the string are.

void OnGUI()
{
    string numberString = GUI.TextField(new Rect(150,80,30,20),"0", 25);
    Debug.Log(numberString);
    int numberInt = Convert.ToInt32(numberString);
}

Once you have more information if you are still unable to get it working edit your question to include the exact contents of the string and we can provide further advice.

You may also find Int32.TryParse useful.