c++ - Message is highlighted in blue in Modal box in VC++ -



c++ - Message is highlighted in blue in Modal box in VC++ -

we using below code populate messages in dialog box, when message appears message highlighted in bluish - it's selected message using mouse. want messages not select when appears. can help me on issue.

cdialog::oninitdialog(); cfont *m_pfont = new cfont(); logfont lf; memset(&lf, 0,sizeof(logfont)); lf.lfheight = 16; lf.lfweight = fw_bold; strncpy_s(lf.lffacename,"arial",6); m_pfont->createfontindirecta(&lf); getdlgitem(idc_edit1)->setfont(m_pfont,true); m_message.setwindowtexta((lpctstr)message); homecoming true;

the selection set text whenever edit box becomes selected item. if edit box first in tab order, or if tab or click on it, characters selected. can override behavior capturing en_setfocus event , resetting selection yourself:

void cmydlg::onensetfocusedit1() { m_edit1.setsel(0, 0); // or (-1, -1) set selection @ end }

c++ visual-c++ mfc

Comments

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -