why its not work

Yairk_kaufmann 6 Reputation points
2021-03-11T14:13:24.697+00:00

76717-%D7%A6%D7%99%D7%9C%D7%95%D7%9D-%D7%9E%D7%A1%D7%9A-2021-03-11-161005.png

float e = 0;  
  
private void button4_Click(object sender, EventArgs e)  
        {  
            if(e >= 0)  
            {  
  
            }  
            j += l / 100;  
            label4.Text = " :mony" + j;  
            //button4.Enabled = true;  
            down();  
        }  
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,626 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Viorel 114.5K Reputation points
    2021-03-11T14:16:56.487+00:00

    There are two e names — the class member and the parameter of the function — and it is not clear which one should be used.

    Try 'if( this.e >= 0 )' or rename the e parameter of button4_Click.

    0 comments No comments

  2. Karen Payne MVP 35,386 Reputation points
    2021-03-11T15:07:58.723+00:00

    It's better to use more descriptive names for variable, here I don't as I don't know what the meaning of each variable is but this is a basic example.

    private float _float1 = 0;
    private int _float2 = 0;
    private int _float3 = 0;
    private void button4_Click(object sender, EventArgs e)
    {
        if (_float1 >= 0)
        {
    
        }
    
        _float2 += _float3 / 100;
        label4.Text = $@" :mony {_float2}";
        down();
    }
    
    0 comments No comments