Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have created a simple program. One of the functions is that it counts clicks, and when the program finishes, a label is displayed with some text and the number of clicks. The code works, but the problem is that the label displays extra text, like this: system.windows.forms.label text

Stevec is set to count clicks. Lable konec already contains text, and in this case I just want to add the extra sentence with the number of clicks.

konec.Text = konec + " Kliknil si: " + Stevec.ToString() + "-krat!";

If anyone has any idea how to display only the text that I have set in the code, I would appreciate it!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
213 views
Welcome To Ask or Share your Answers For Others

1 Answer

You need the Text property instead of the control itself:

konec.Text = konec.Text + " Kliknil si: " + Stevec.ToString() + "-krat!";

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...