issselected and styles

  • Hi,

    I'm using DevExpress combos so I'm setting styles etc... via code. The only thing I can't get to work right is when I have text selected and try to change a style. If I click on a paragraph and change the style it works fine. I can also iterate the parstyles and see that they are loaded. Below is what I'm doing, the code executes when the combobox closesup, the bolded text is what I can't get to work.

    if (cb_p_style.CurText = '<New Style...>') or (cb_p_style.curText = '<Edit Style...>') then
    sty_dlg.Execute
    else
    if write1.IsSelected = true then
    begin
    i := write1.ParStyles.GetID(cb_p_style.CurText);
    Write1.SelectedTextAttr.SetCharStyleSheet(i);
    end

    else
    begin
    par := write1.ActivePar;
    write1.CurrAttr.StyleName := cb_p_style.CurText;
    end;

    Any ideas on what I'm doing wrong?

    Thanks, Greg R