How do I add HTML links in C# TextBox? - c#

How can I put a link in a C# TextBox? I have tried to put HTML tags in the box but instead of showing a link it shows the entire HTML tag. Can this be done with a TextBox?

Use the RichTextBox, no need to build your own, it cames with VS

I would try using an editable div and making it look like a text box. This would allow you to get user input and use links.
To make this easier, try JEditable.

If that is in windows forms and you really can't use the richtextbox, you can create a control with a linklabel inside of textbox.
http://www.codeproject.com/KB/miscctrl/LinkTextBox.aspx

I would think about this a little bit. If you allow executable code in an editable control, the user, the user can execute ANY code. This is generally a bad idea.
The behavior of the C# control is intentional to prevent the exact behavior that you are trying to create. A little creativity (such as parsing out links from the text box and creating a list of links next or below the text box) will provide a much safer application.

To my knowledge not with the standard textbox. You'd have to create your own. One option it the Telerik controls, they're a little pricey for individual development, but very robust and configurable.

For windows application, we can use a webbrowser control. However, for web applications Freetextbox will do the job.This is freely available dll.

Related

Rich Text Box in Xamarin.Forms

I am currently porting my application from WPF to Cross-platform. In the WPF, I used a read-only richtextbox to show the result to user in order to show both IMAGE & TEXT. In Xamarin.Forms, Is there anything similar? Thanks.
There is no control in Xamarin Forms, hence you would have to use CustomRenderers and create your own.
However I only found one decent RichTextBox implementation in
UWP RichTextBox
This means that the only way to get any decent RichTextEditor, is to use a WebView, and load a WebBased rich text editor.
But since you want it as read-only, the simplest thing to do, is to scrap the idea of any RichTextBox, and just display the text and image as separate components in your mobile app.
You can use Spans, in a label to implement formatting within the label if needed.
I found the Telerik RichTextEditor for Xamarin a much better Rich Text Editor package for Xamarin Forms after trying out and evaluating a handful of other alternatives.
This is licensed software and you have to pay for using it.
Here's the link, https://docs.telerik.com/devtools/xamarin/controls/richtexteditor/richtexteditor-overview
ScrollView can be used like readonly richtextbox. I added the elements programmatically(label for text and image). It's also read-only so it met my requirements
Syncfusion's brand-new rich text editor control for Xamarin.Forms is available now. Check out the following article for more detail.
https://www.syncfusion.com/blogs/post/introducing-xamarin-forms-rich-text-editor.aspx

Winforms control for displaying html text

I am coding a Windows Forms Application in C#, and one of the requirements is to display some html code in a control, with the correct colors that correspond to the relevant tags.
E.g. When right clicking on a webpage in Google Chrome, then selecting View Page Source, a form is shown with all the html, correctly formatted, with tag colors and each line of code's line number.
Is there a free, reliable control that can do this? Is there an inbuilt Microsoft control that does this?
As I am new to this area of coding, can someone please provide me with some useful names, and some resource links if possible? I am not sure of the correct name for a control that does this, and as such, my Google searches have not come up with what I am looking for.
Also, the control needs to be trustworthy.
Thanks
You can try ScintillaNET control. It's open source and has HTML syntax highlighting as well as many other features.

How to create a Dropdown button in asp.net c#?

Does anyone know the name of the property in which it look alike button
but once if we keep the mouse pointer
on it then it will show like dropdown
list options.
I want to use that in my asp.net
project.
There is no out of the box control as such. It is an effect achieved either using javascript or CSS
Take a look at this example
http://demos.9lessons.info/DropMenu/MyDemo.html
You should also search for jquery plugins for this. Though you will get readymade code for it but it will surely not be a server side control. You have choice of either creating a user control or just use it as it is.
unfortunately there is no such control out of the box in asp.net. you might want to look at third party controls or do some css magic.
Something like that maybe a standart one(1) .But I can recommend you to use telerik if you are using it already here is a example (2)
Example2
Example2

how i integrate html text editor in windows application?

how i integrate html text editor in windows application?
The best option would be to use a commercial syntax highlighting package, such as Actipro SyntaxEditor.
You can just use a RichTextBox and do it yourself, but it is going to be more difficult to make this seem polished. There are some articles, such as the CodeProject article, which show how to extend RichTextBox for custom editing and coloring. That would be a good starting point, if you want to make your own.
If you just want a place people can type HTML in, but don't need coloring, syntax checking, etc - you can just use a RichTextBox and let the user type in the HTML.

WYSIWYG Control for Winform

I am looking for a free WYSIWYG editor control to be used in a Winform application. The applications primary language is VB but using C# is also an option. To clarify I need a rich text editor control that has a formatting bar. I have looked all over the web and the only options I can find are expensive control packages that have more than I need. I am not adverse to creating my own version of this control, it would just be nice to find a free and open alternative.
In this scenario, starting with CodeProject articles seems the easiest:
http://www.codeproject.com/KB/edit/editor_in_windows_forms.aspx -- Not my first recommendation, but perhaps of use if you want HTML.
http://www.codeproject.com/KB/edit/TextRulerControl.aspx?fid=968441&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26&select=2438044
http://www.codeproject.com/KB/cs/eRichTextBox.aspx
Actually it's very easy to write your own based on the RichTextBox control.
I would go that way for sure. Your biggest problem will be the icons for the edit bar.
Check this one for starter.

Categories