Enable the combo box added in the toolbar to receive the carriage return message.

Source: Internet
Author: User

We have previously implemented adding a combo box in the toolbar, and it is easy to execute a search in the view through the data input in the combo box. Now, we have encountered a problem, that is, every time you input data, you have to click the search button next to it. In IE, enter the URL and press enter to transfer it to the corresponding website. In the document view program, let the combo box directly press enter to send a message. 1. Add the IDOK message function declaration [cpp] afx_msg void OnOK () to the CxxxView class declaration; 2. Add the message ing [cpp] www.2cto to the Message ing table implemented by the CxxxView class. comBEGIN_MESSAGE_MAP (CCenterServerView, CListView )...... ON_COMMAND (IDOK, OnOK) END_MESSAGE_MAP () 3. Add the message Response Function in the CxxxView class implementation section [cpp] void CCenterServerView: OnOK () {AfxMessageBox (_ T ("cview");} in this case, when the focus is on the toolbar's combo box, you press the Enter key to bring up the cview message box.

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.