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
Related
I'm working on a windows forms application that reads and displays source code files from my hard drive. I'm not sure which control would be best suited for this. Is there any library that will allow me to display the source code with colors and numbered code-lines?
EDIT: To clarify, what i'm looking for is a way to display the code with colors and line-numbers, no need for editing. The application is to be used by a teacher, allowing him to view source code files handed in by his students. The teacher doesn't have to be able to edit the files.
ScintillaNet is a WinForms control which is a .NET wrapper of the excellent Scintilla library and is quite good. Avalon which is mentioned in another answer is also very good, but it is an WPF control (of course, WPF controls can be added to WinForms forms by using ElementHost controls, but it will introduce additional complexity which may or may not be warranted).
I am trying to reproduce a window from the Microsoft built-in Registry Editor. The window is the one which is opened when you select "Modify Binary Data..." from the context-menu when a value is clicked.
The goal is to make an identical(!) window in my .NET C# application using Windows Forms.
The problem is the textBox displayed in the window which contains the binary data. I have tried using a RichTextBox, but it isn't as simple as it seems to be especially when it comes to editing data and the behaviour of this textBox.
So I have 2 questions:
How to achieve an identical textBox in C# using Windows Forms? Maybe you know some other ways to reproduce this textBox?
I also need the font name used in this textBox, I couldn't find it :)
Thanks!
I can think of two ways you can approach this. The first is a DataGrid, painstakingly styled to have transparent grid lines and exact margins between columns, with filters to enforce hex digits only. All this, set alongside a richtextbox for the ASCII display, with your code synchronizing the selection between them.
Alternately, you can replace the DataGrid with a collection of TextBoxes, again styled for invisible borders, automatically adding new textboxes to the collection when the user adds more data.
All in all, it seems like an awful lot of work, especially in WinForms - WPF might make this a bit easier, especially the styling, but still a lot of work.
Regarding the name of that control - I tried using Spy++ to sniff it out, and it seems it's registered as a Window Class named "HEX", but I'm not sure that will really get you somewhere:
Here is an open source project containing a hex editor control for Winforms, looking at least very similar:
http://sourceforge.net/projects/hexbox/
I guess you can modify it accordingly to your requirements. But beware, the source code for the control is ~6000 lines of code (including more than a dozen utility classes). It inherits directly from "Control" and does all the text display using GDI+ (so no modified DataGrid or RichTextBox).
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.
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.
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.