Page 1 of 1

Rolling my own Styles combobox/list

Posted: Tue Jan 31, 2006 6:40 pm
by aoven
What would be the best way of maintaining a list of all styles that are available in the current document at a given time?

Ideally, it should work exactly like the font combobox - updating ItemIndex on caret movements and applying selected style to text.

Aleksander

Posted: Tue Jan 31, 2006 7:02 pm
by Sergey Tkachenko
It makes sense to add only styles having Standard property = True.
All styles added as a result of editing operations have Standard=False, so editing operations do not change items of such list.

List of styles may be changed only when you load a new RVF document.

For changing ItemIndex, use RichViewEdit.OnCurTextStyleChanged. For applying, use ApplyTextStyle