CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2008
    Posts
    28

    Change the shape of CEdit custom draw?

    Hi,

    I've created CCustomEdit inherited from CEdit and managed to change its background color and text color.
    I'm trying to change the shape of it ( eg : on each end i plan to make it like curve a bit rather than 90 degrees )

    Is there any ways to change the shape of the CEdit ? Any tutorials/sample would be highly appreciated. Can GDI able to change the style of it?
    My project is MFC based.

    With thanks,
    KarHong

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Change the shape of CEdit custom draw?

    Handle the WM_PAINT message to draw the edit yourself.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Dec 2008
    Posts
    28

    Re: Change the shape of CEdit custom draw?

    Can you give me some sample on how to draw it ?
    thank you for your reply!

  4. #4
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Change the shape of CEdit custom draw?

    I'm sure you can find samples on the web. Consider this: http://www.codeguru.com/cpp/v-s/devs...icle.php/c8491.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  5. #5
    Join Date
    Dec 2008
    Posts
    114

    Re: Change the shape of CEdit custom draw?

    WM_PAINT is irrelevant as Edit draws on WM_NCPAINT (see source code of Edit control...)
    Just use regions

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: Change the shape of CEdit custom draw?

    Quote Originally Posted by carl666 View Post
    ... (see source code of Edit control...)
    Please, provide a link to the "source code of Edit control"!
    Victor Nijegorodov

  7. #7
    Join Date
    Dec 2008
    Posts
    28

    Re: Change the shape of CEdit custom draw?

    I've tested using regions.. but.. it doesnt work
    any help?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured