Click here to Skip to main content
12,750,217 members (35,430 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C++ MFC WTL
hi,
i want to change the color and size of the bullets in a richedit,and do not change the text.

i do not get a effective method to do it.

I found that ,i can change the font ,color and size of bullets in word,and i want to get the effect look like the word.

who can help me?

        //Set Bullets
        // here ,it work well,i can see the Bullets
	PARAFORMAT2 pf2; 
	pf2.cbSize = sizeof(PARAFORMAT2); 
	pf2.dwMask = PFM_NUMBERING; 
	pf2.wNumbering = PFN_BULLET;
	SetSel(imInfo.iLastStart,imInfo.iLastStart+1);
	SetParaFormat(pf2);

	//i want to change the color and size of the Bullets
	CHARFORMAT cfPoint = m_curcf;
	cfPoint.crTextColor = RGB(120,120,120);
	cfPoint.yHeight = 13*13;
         

        //?????????????
        //here,what shall i do to get the effect.


Posted 28-Nov-12 16:00pm
Updated 28-Nov-12 16:03pm
v3
Comments
lin98666521 6-Dec-12 0:13am
   
i have Solve the problem by myself.
i find that,the color and size of the bullets are the same to the last "\r",so i remeber the position ,and find the first "\r" from the position to set it color and size.

if(imInfo.iLastStart!=0)
{
SetSel(imInfo.iLastStart,imInfo.iLastStart+1);
SetParaFormat(pf2);

FINDTEXTEXW ft;//
ft.chrg.cpMin = imInfo.iLastStart;
ft.chrg.cpMax = -1;
ft.lpstrText=_T("\r");
long n = FindText(FR_DOWN,ft);
if(n!=-1)
{
SetSel( n,n+1);
SetWordCharFormat( cfPoint );
}
imInfo.iLastStart = 0;
}

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

i have Solve the problem by myself.
i find that,the color and size of the bullets are the same to the last "\r",so i remeber the position ,and find the first "\r" from the position to set it color and size.

if(imInfo.iLastStart!=0)
  {
     SetSel(imInfo.iLastStart,imInfo.iLastStart+1);
        SetParaFormat(pf2);

     FINDTEXTEXW   ft;//
       ft.chrg.cpMin   =   imInfo.iLastStart; 
       ft.chrg.cpMax   =   -1; 
      ft.lpstrText=_T("\r");
        long   n   =  FindText(FR_DOWN,ft);
       if(n!=-1)
     {
         SetSel( n,n+1);
           SetWordCharFormat( cfPoint );
     }
     imInfo.iLastStart = 0;
    }
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170215.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100