CS0120: An object reference is required for the nonstatic field, method, or property 'foo'

前端 未结 7 1089
挽巷
挽巷 2020-11-21 04:34

Consider:

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


        
7条回答
  •  甜味超标
    2020-11-21 05:20

    You start a thread which runs the static method SumData. However, SumData calls SetTextboxText which isn't static. Thus you need an instance of your form to call SetTextboxText.

提交回复
热议问题