Click here to Skip to main content
Rate this: bad
good
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 15:00pm
Edited 28-Nov-12 15:03pm
v3
Comments
lin98666521 at 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
0 OriginalGriff 205
1 Sergey Alexandrovich Kryukov 200
2 Rob Philpott 100
3 Prakriti Goyal 97
4 jlopez788 94
0 OriginalGriff 6,837
1 Sergey Alexandrovich Kryukov 5,589
2 Maciej Los 3,479
3 Peter Leow 3,323
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2014
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