In my MFC application i am using CRichEdit control for multiline text.
I have set the below properties for the rich edit control.
ES_MULTILINE | ES_NOHIDESEL | ES_READONLY | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,WS_EX_CLIENTEDGE | WS_EX_STATICEDGE
Vertical and Horizontal Scrollbar appears automatically when the text entered is more than the display area. This is working as expected.
I am having one clear button in my application which is to clear the text in rich edit control. But when i click the clear button vertical scrollbar disappears but the horizantal scrollbar is not disappearing.
Can anyone help me out in this?
when ever i click the clear button the below code will be exceuted.
CString strConsoleInit(_T("ADB SHELL COMMAND WINDOW \n\n"));
strConsoleInit += CONSOLE_DELIMITER;
m_ADBShellConsole.SetWindowTextW(strConsoleInit);
m_ADBShellConsole.SetReadOnly(false);
long nBegin = m_ADBShellConsole.GetTextLength();
int nIndex = 0;
int nCount = 0;
while(true)
{
int nPos = strConsoleInit.Find(_T('\n'),nIndex);
if(nPos < 0)
{
break;
}
++nCount;
nIndex = nPos + 1;
}
m_ADBShellConsole.SetConsoleTextLength(nBegin-nCount);
m_BtnClear.EnableWindow();
((CRAPC_AgentDlg *)m_ADBShellConsole.GetParent())->Invalidate();
I m setting the rich edit control text as below
ADB SHELL COMMAND WINDOW
INPUT COMMAND :