Thread: custom controls

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    103

    custom controls

    does anybody know how to create custom controls and use them like standard controls.. the mfc activex wizard is perfect only i dont want it as an ocx i want to include it in the exe and as far as i can see i cant do much with the Custom Control from mfc

  2. #2

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    103
    thx but it is really hard this way and can you use it more than 1 time ?

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    103
    old thread

    um i mean i wanna make a custom control just like in visual basic if anybody worked with it you make usercontrols very easy almost like creating activex controls in c++ but with these from c++ you can't put them in the exe.. so how do you exactly make a custom control in mfc c++ to use it as many times as you want..

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    You derive a class from the desired controls base class (ie CMyEdit from CEdit ), subclass as required (add functionality to your requirements).

    Include this class in any required apps (CMyEdit).

    If use resource editor add controls as base type (CEdit) and then edit generated code to change base class (CEdit) to your subclassed type (CMyEdit)

    If creating at run time declare as subclassed type (CMyEdit) and use the base classes' functionality ( CEdit.Create() )
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #6
    Registered User
    Join Date
    Dec 2004
    Posts
    103
    ah i see but if i want to make my own control( a flat button ) i make a class for it but how do i have it in the control bar ? and place it on the dlg window

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unable to remotly register my custom controls.
    By Yarin in forum Windows Programming
    Replies: 8
    Last Post: 08-13-2007, 12:20 PM
  2. Creating Custom Controls
    By Grayson_Peddie in forum C# Programming
    Replies: 1
    Last Post: 12-29-2003, 01:41 PM
  3. Custom Controls
    By Mithoric in forum Windows Programming
    Replies: 6
    Last Post: 12-21-2003, 10:09 PM
  4. Custom controls
    By Mithoric in forum Windows Programming
    Replies: 3
    Last Post: 12-02-2003, 04:58 AM
  5. I need help disabling Keyboard and Mouse input on Edit controls
    By Templario in forum Windows Programming
    Replies: 4
    Last Post: 01-07-2003, 12:59 AM