Chapter 16: Text-Based Controls Visual C++ and MFC Fundamentals
void CRicher1Dlg::OnBnClickedBtnCenter()
{
// TODO: Add your control notification handler code here
PARAFORMAT Pfm;Pfm.cbSize = sizeof(PARAFORMAT);
Pfm.dwMask = PFM_ALIGNMENT;
Pfm.wAlignment = PFA_CENTER;m_Richer.SetParaFormat(Pfm);
m_Richer.SetFocus();
}void CRicher1Dlg::OnBnClickedBtnRight()
{
// TODO: Add your control notification handler code here
PARAFORMAT Pfm;Pfm.cbSize = sizeof(PARAFORMAT);
Pfm.dwMask = PFM_ALIGNMENT;
Pfm.wAlignment = PFA_RIGHT;m_Richer.SetParaFormat(Pfm);
m_Richer.SetFocus();
}void CRicher1Dlg::OnBnClickedBtnBullet()
{
// TODO: Add your control notification handler code here
PARAFORMAT Pfm;m_Richer.GetParaFormat(Pfm);
Pfm.cbSize = sizeof(PARAFORMAT);
Pfm.dwMask = PFM_NUMBERING;Pfm.wNumbering ^= PFN_BULLET;m_Richer.SetParaFormat(Pfm);
m_Richer.SetFocus();
}- Test the application