I’m using VS2010, C# to develop a WinForm application, is there a way to use two fonts in a textbox? for instance my user is typing with Tahoma font, then he can press a key combination or click on a button and he can type with Times New Roman font (text typed with Tahoma should not change its font)
what are my options? I suppose RichTextBox is my only options, is it right? if so, how can I remove RichTextBox icons and toolbars?
what about Telerik or other third party components?
As you say,
RichTextBoxwill help you doing what you ask for. However, I do not understand your statement about removing icons and toolbars. The contrary is true, you will have to create your own buttons in order to enable formatting.As an example I show you how can toggle the bold style of the selection
As you can see this is quite complicated, since the current text selection can contain text parts that are formatted differently. This code changes the font style in a piece-wise manner, ensuring that a piece has a unique format.
In order to provide a user friendly interface you also will have to treat text selection events and to toggle the style buttons according to the formatting of the selection. I.e. if the user selects a bold text, then the bold-toggle-button should be in the pressed-state.