Click here to Skip to main content
15,886,798 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?

C++
    //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
Updated 28-Nov-12 15: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

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.

C++
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;
}
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900