Need Help

Jun 3, 2016 at 3:05 PM
Hi,

I need help, to add Underline button to default toolbar, please help me, i have added toolbar using bellow code.

YARTE.UI.Buttons.PredefinedButtonSets.SetupDefaultButtons(htmlEditor1);

i also want to add custom button to this.
Jun 3, 2016 at 3:08 PM
The "SetupDefaultButtons" is simply a convenient method, but you can add buttons of your own.

To add buttons, you can use AddToolbarItem.

You can check out the document for more information: https://yarte.codeplex.com/wikipage?title=Detailed%20Documentation&referringTitle=Documentation
Jun 3, 2016 at 3:15 PM
can you give me example code, please

Thanks & Regards,
Sunil Dabhi


Jun 3, 2016 at 3:21 PM
Edited Jun 3, 2016 at 3:21 PM
It's right there in that link.

Look at IHTMLEditorButton example at the bottom for how you would create a custom button class.

Once you've created that class (maybe you called it MyButton), use AddToolBarItem(new MyButton()).
Jun 3, 2016 at 3:23 PM
Oh, actually I see you want to add Underline, which already exists.

So you can just AddToolBarItem(new UnderlineButton())

I highly advise against using underline if this tool is creating content for the web. Underlines usually mean "link" to people, so you don't want underlined text that's not a link. See: https://www.nngroup.com/articles/guidelines-for-visualizing-links/
Jun 3, 2016 at 3:51 PM
ok thanks

Thanks & Regards,
Sunil Dabhi