Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Label with Text parameter

$
0
0

Hello

I'm encountering the following problem: I got a TextBlock that I programmatically create and I want to use the "template" but with different text content as in the following example:

Label test = new Label
{
    Enabled = true
};

And I would like to use it as this

test("Text sample" + Environment.NewLine + "Another line" + randomString);

I know the answer is pretty lame and that this is a question for beginners but I've never had to use it before and the examples provided didn't help me.


Thanks anticipated!




Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>