Change button content in WPF

前端 未结 2 783
攒了一身酷
攒了一身酷 2021-01-25 02:04

I have:

private void button1_MouseEnter(object sender, EventArgs e)
{
    for (int i = 0; i > 2; i++) 
    {     
        button1.Content = Convert.ToString(i         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-25 02:40

    Hi is your for loop correct? It should be i<2 instead of i>2

     for (int i = 0; i < 2; i++)
            {
    

提交回复
热议问题