Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Bit Edit Control

Bit Edit Control

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SzyKam
    wrote on last edited by
    #1

    Hello! Anybody knows how to make EditBox to accept only bitwise strings (0 and 1), something like ES_NUMBER that allows only digits to be entered into the Edit Control. SzyKam.

    C U 2 Replies Last reply
    0
    • S SzyKam

      Hello! Anybody knows how to make EditBox to accept only bitwise strings (0 and 1), something like ES_NUMBER that allows only digits to be entered into the Edit Control. SzyKam.

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      I don't know such a control but you can do one yourself quite easily: create a new class (CBitwisEdit for example) that inherits from the CEditCtrl. Override the OnChar function. Inside this function, check if the char entered is either '0' or '1'. If this is the case, call CEditCtrl::OnChar, otherwise don't call it.


      Cédric Moonen Software developer
      Charting control [Updated - v1.1]

      1 Reply Last reply
      0
      • S SzyKam

        Hello! Anybody knows how to make EditBox to accept only bitwise strings (0 and 1), something like ES_NUMBER that allows only digits to be entered into the Edit Control. SzyKam.

        U Offline
        U Offline
        uday kiran janaswamy
        wrote on last edited by
        #3

        hi, In order to Accept Numeric Values in the EditControl, You have to SubClass the EditControl by Creating a new CEdit Class and specify the Messages. In our Instance WM_CHAR. in the WM_Char Message check for the Only Numeric Variable. Think Clever. Uday kiran

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups