c# .net change label text

前端 未结 6 1858
眼角桃花
眼角桃花 2021-01-05 07:21

Hello for I trying to use this code but for some reason it doesn\'t work. Really need help with this. The problem is that the label doesn\'t change name from \"label\" when

6条回答
  •  我在风中等你
    2021-01-05 07:56

    If I understand correctly you may be experiencing the problem because in order to be able to set the labels "text" property you actually have to use the "content" property.

    so instead of:

      Label output = null;
            output = Label1;
            output.Text = "hello";
    

    try:

    Label output = null;
                output = Label1;
                output.Content = "hello";
    

提交回复
热议问题