none
Object Reference is required for nonstatic field when trying to pass value to another form? RRS feed

  • Question

  • namespace BotMod
    {
        public partial class Options : Form
        {
    
            public string small = ("0");
        
        public Options(int small)
            {
                InitializeComponent();
                
            }
    
            private void returnbtn_Click(object sender, EventArgs e)
            {
    
                
    
    
                if (passcombo.Text == ("Small"))
                    {
                    small = ("1");
                    
    
                }
    
    
                Form1 form1 = new Form1();
    
                this.Hide();
                
                form1.Show();
    
                passcombo.Text = GameForm.passlbl.Text;
    
    
            }

    This is the form I have the value on, I want to pass the value small containing the number 1 to the other form called GameForm.

    How to do this?

    Wednesday, November 8, 2017 5:07 PM