Easy, check for style of a CEdit

Posted on 2006-03-29
Last Modified: 2013-11-20

Easy question, how do I check if a CEdit has the ES_MULTILINE property specified?

I know it's something like:

    CEdit m_Edit;

    bool bIsMultiline = m_Edit.GetStyle() |= ES_MULTILINE ? true : false;

What's the funny bitwise check you can do though?

Question by:minnirok
    LVL 86

    Accepted Solution

    You'll need to use

    bool bIsMultiline = m_Edit.GetStyle() & ES_MULTILINE ? true : false;

    or a bit simpler

    bool bIsMultiline = m_Edit.GetStyle() & ES_MULTILINE;

    '&' is the bitwise AND operator.
    LVL 7

    Author Comment

    Ah yeah that's what I was looking for, thanks.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
    Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now