Using a variable in multiple functions of the class C#

I've been working on a game and there's a field in which the player enters his name, which is later used to add the record to the table of records. I'm not allowed to use the standart TextBox class, so I need to create one (TBox.cs) in which there are two functions: "TBoxRender" which is used to update the textbox every time a new symbol is entered, and another is "ReturnText" which gives access to the string variable from other classes. The problem is that I can't get the new str variable through return, it returns str as it was declared. So instead of returning string "somethingblablabla" it returns just "something" no matter how it changed in this class. Passing str to ReturnText() is not an option as this functions is called from outside the class.
I tried declaring it as static and moved it outside of functions, so technically it should have done the trick, but it still doesn't work. Could you help me?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;

namespace Labyrinth
{
    class TBox
    {
        public Rectangle rect;
        Pen rectPen = new Pen(Color.Black, 2);
        SolidBrush textBrush = new SolidBrush(Color.Black);
        string str;

        public TBox()
        {
            str = "something";
        }


        public void TBoxRender(Graphics g, int x, int y, int length, int height, char enteredSymbol, int fontSize)
        {
            rect = new Rectangle(x, y, length, height);
            g.DrawRectangle(rectPen, rect);
            FontFamily ff = new FontFamily("BrushType");
            StringFormat stringF = new StringFormat();
            stringF.Alignment = StringAlignment.Center;
            stringF.LineAlignment = StringAlignment.Center;
            System.Drawing.Font font = new System.Drawing.Font(ff, fontSize);
            if (enteredSymbol == '\b')
            {
                if (str.Length > 0)
                {
                    str = str.Remove(str.Length - 1);
                }
            }
            else
           str += enteredSymbol;
            g.DrawString(str, font, textBrush, x+length/2, y+height/2+5, stringF);
        }

   public string ReturnText()
        {
            return str;
        }
    }
}

The classes where I call the functions from

MainMenu.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Data;

namespace Labyrinth
{
    class MainMenu
    {
        Image bg = Image.FromFile("Labyrinth_menu.png");
        Button playButton = new Button();
        Button recordsButton = new Button();
        Button quitButton = new Button();
        Button nameButton = new Button();
        TBox tBox = new TBox();
        Text text = new Text();

        public void RenderMenu(Graphics g)
        {

            Button button1 = new Button();
            g.DrawImage(bg, 0, 0, 720, 480);
            button1.RenderButton(g, 200, 10, 300, 100, "Лабиринт", 50);
            playButton.RenderButton(g, 0, 150, 300, 60, "Играть", 35);
            recordsButton.RenderButton(g, 0, 215, 300, 60, "Рекорды", 35);
            quitButton.RenderButton(g, 0, 280, 300, 60, "Выйти", 35);
        }

        public int Click(int X, int Y)
        {       
            bool play = playButton.Click(X, Y);  
            bool records = recordsButton.Click(X, Y);
            bool quit = quitButton.Click(X, Y);
            bool nameEntered = nameButton.Click(X, Y);
            if (play == true) return 1;
            else if
            (records == true) return 2;
            else if
            (quit == true) return 3;
            else if
            (nameEntered == true) return 4;
            else return 0;

        }

        public void EnterName(Graphics g, char enteredSymbol)
        {
            text.RenderText(g, 250, 120, "Введите свое имя", 25);
            tBox.TBoxRender(g, 250, 160, 200, 50, enteredSymbol, 30);
            nameButton.RenderButton(g, 200, 270, 300, 100, "Играть!", 60);
        }

        public string GetName()
        {
            return tBox.ReturnText();
        }


    }
}

And Form1.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;

namespace Labyrinth
{
    public partial class Form1 : Form
    {
        MainMenu menu = new MainMenu();
        GameWindow game = new GameWindow();
        char enteredSymbol;

        int window;

        public Form1()
        {
            InitializeComponent();
            this.DoubleBuffered=true;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            window = 0;
        }

        private void Form1_Paint_1(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            switch (window)
            {
                case 0:
                    menu.RenderMenu(g);
                    break;
                case 1:
                    menu.EnterName(g, enteredSymbol);  
                    break;
                case 2:
                    game.RenderGame(g, 1);
                    break;
        }
        }

        private void Form1_MouseClick(object sender, MouseEventArgs e)
        {
            int clicked = menu.Click(e.X, e.Y);
            switch (clicked)
            {
                case 1:
                    this.Invalidate();
                    window = 1;
                    break;
                case 2:
                    MessageBox.Show("Таблица рекордов");
                    this.Invalidate();
                    window = 3;
                    break;
                case 3:
                    Application.Exit();
                    break;
                case 4:
                    MessageBox.Show(menu.GetName());
                    this.Invalidate();
                    window = 2;
                    break;
            }
        }

        private void Form1_KeyPress(object sender, KeyPressEventArgs e)
        {
             char key = e.KeyChar;

            if (window == 1)
            {
                enteredSymbol = key;
                Invalidate();
            }
            else if (window == 2)
            {
                game.UpdatePlayer(key.ToString());
                Invalidate();
            }


        }
    }
}