trichview.com

trichview.support




can't change bkcolor to black .why?


Return to index


Author

Message

bagio

Posted: 08/12/2003 14:06:45


In a RichViewEdit ,I want set some words bkcolor to black,

Code:

void __fastcall TFrameEdit::RichViewEditStyleConversion(

      TCustomRichViewEdit *Sender, int StyleNo, int UserData,

      bool AppliedToText, int &NewStyleNo)

{

  TFontInfo* FontInfo = new TFontInfo(NULL);

  FontInfo->Assign(RVStyle->TextStyles->Items[StyleNo]);

  switch (UserData)

  {

     case DEMO_APPLYCOLOR:

      FontInfo->Color = clBlack;

      break;

}

  NewStyleNo = RVStyle->TextStyles->FindSuchStyle(StyleNo,FontInfo,RVAllFontInfoProperties);

  if (NewStyleNo<0)

  {

    RVStyle->TextStyles->Add();

    NewStyleNo = RVStyle->TextStyles->Count-1;

    RVStyle->TextStyles->Items[NewStyleNo]->Assign(FontInfo);

    RVStyle->TextStyles->Items[NewStyleNo]->Standard = false;

  }

  delete FontInfo;



but the NewStyleNo is always =0,so can't change bkcolor to black .why?





Powered by ABC Amber Outlook Express Converter