Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinForms: How to align a LinkLabel within a paragraph of text?

I have a label being populated with dynamic text. It is often a paragraph or so in length. I need to seamlessly integrate a LinkLabel at the end of this paragraph with the words "View more ..." .

It should look like this:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur laoreet bibendum tortor. Donec lacinia orci euismod lorem mollis consectetur. Pellentesque velit lacus, auctor in dignissim ac, malesuada at justo. Praesent bibendum tempus facilisis. View more ...

I've included a Label and a LinkLabel within a panel but cannot align these two controls so that they flow together seamlessly.

How do I accomplish this within WinForms?

Thank you.

like image 391
AlexScript Avatar asked Nov 16 '11 17:11

AlexScript


People also ask

How do I center a Label in Windows Forms?

Set Label 's AutoSize property to False , TextAlign property to MiddleCenter and Dock property to Fill .

How do I align the right side of a Label?

We specify the margin-bottom of our <div> element. Then, we set the display of the <label> element to "inline-block" and give a fixed width. After that, set the text-align property to "right", and the labels will be aligned with the inputs on the right side.

What is the difference between Label and link lable in net?

A link label is like a hyperlink that you'd see on a webpage. It's a label thats blue and has an underline and, when clicked, can point to a URL. A label is just a label.


1 Answers

Add all text to the LinkLabel, and use the LinkArea property to set what area in the text is actual a link.

like image 117
Patrick Avatar answered Sep 29 '22 06:09

Patrick