Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying a mix of plain-text and hyperlinks in a WinForm

Status
Not open for further replies.

DotNetter

Programmer
May 19, 2005
194
US
I have a list of items to display to users in a VB.NET WinForm app. The list will be mostly plain text, with some hyperlinks sprinkled in, as well. I don't want the text to be edited. (Probably not relevent, but the text is coming from a stored procedure, one "item"/line per row of the resultset.)

What's the best control to use to easily display this in a read-only fashion?

Thanks!
Dot
 
Try something like:

Code:
    Dim s As String = "This is some text in a RichTextBox.  "
    s += "It includes URLs like [URL unfurl="true"]www.thisismysite.com[/URL] and [URL unfurl="true"]www.thisisalsomysite.co.uk.[/URL]  "
    s += "Set the DetectURLs property to True (this is the default) to enable this feature.  "
    s += "To prevent the user from editing this text set the ReadOnly property to True."

    RichTextBox1.Text = s

Hope this helps.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top