How to keep the scroll bar at the bottom of the edit box when multiple lines are displayed

Source: Internet
Author: User

Two methods:

① Cedit * pedit = (cedit *) getdlgitem (idc_edit_rxdata ));

Pedit-> linescroll (pedit-> getlinecount (); // scroll down to the bottom

Int tmplen = pedit-> getwindowtextlength ();

Pedit-> setsel (tmplen,-1, true); // locate the cursor to the end of the content

In this way, a screen will pop up!

② Int nlen = m_ctlrxdata.getwindowtextlength ();

M_ctlrxdata.setsel (nlen, nlen );

M_ctlrxdata.replacesel (strtemp );

M_ctlrxdata is the control variable and strtemp is the content to be displayed. No pop-up screen is displayed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.