"Go" MFC edit box Wrap line, vertical scroll bar automatically Move Down

Source: Internet
Author: User

1. Create a new edit box control, tick its multiline (Multiline) Front (property set to True), auto HScroll the front tick (property set false), so that each line is filled and then wrapped automatically.

2. Tick the vertical scrollbar (vetrical Scroll) before the vertical scroll bar appears when the input or display exceeds the size of the edit box (the property is set to true).

3. If it is input, the scroll bar will automatically move to follow the current input line, but if the settings will be a lot of content once the edit box display, the scroll bar will always be at the top, you need to manually pull to the bottom to see the last line of content, in many cases this is not needed, but want the scroll bar at the bottom, The following code will implement this function:

This->setdlgitemtext (IDC_EDIT_RECV,STR);//Displays the contents of the string str to an edit box with ID idc_edit_recv
M_recvshw. Linescroll (M_RECVSHW. Getlinecount ());//M_RECVSHW is the member variable of the edit box (that is, a variable of control type)
Use some member functions of a control variable to set the position of the scroll bar

See http://blog.csdn.net/wu_lai_314/article/details/8317395

"Go" MFC edit box Wrap line, vertical scroll bar automatically Move Down

Related Article

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.