我现在在公司做一个项目,用到了richEdit控件,想实现的功能是:设置richEdit控件中指定文本的颜色,但不知道该如何实现,希望高手们指点我下,我需急用。希望分享一下相关的代码,谢了!下面给出一部分,我的richEidt控件上要显示的内容,然后指出哪些文本需要设置字体样式,richEdit要显示的内容如下:交易商代码:***     交易商名称:***
期初余额:***       当日可用资金:***其中“交易商代码”、“交易商名称”、“期初余额”要粗体显示,它们的取值要正常显示,而“当日可用资金”和他的取值用蓝色高亮显示
谁要是能按照我给出的例子,写出相关的代码就更好了,我把积分全部给你

解决方案 »

  1.   

    BOOL SetDefaultCharFormat(
       CHARFORMAT& cf 
    );
    BOOL SetDefaultCharFormat(
       CHARFORMAT2& cf 
    );
     
      

  2.   

    SetDefaultCharFormat 
     Sets the current default character formatting attributes in this CRichEditCtrl object. 
     
    SetParaFormat 
     Sets the paragraph formatting attributes in the current selection in this CRichEditCtrl object. 
     
    SetSelectionCharFormat 
     Sets the character formatting attributes in the current selection in this CRichEditCtrl object. 
     
    SetWordCharFormat 
     Sets the character formatting attributes in the current word in this CRichEditCtrl object.