[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

C++ MFC | Rounded Text Box

Posted on 2015-01-02
1
Medium Priority
?
460 Views
Last Modified: 2015-01-15
Hi Experts,
I would like to achieve a text box (edit box) with rounded corners in MFC. Can someone please help me achieve the same using MFC? This is with VS 2010.

Thanks and regards,
Karrtik
0
Comment
Question by:Karrtik Iyer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 31

Accepted Solution

by:
Zoppo earned 2000 total points
ID: 40548513
Hi Karrtik Iyer,

sorry, I would have written earlier but I was in holiday. If this is still an issue for you maybe I can help you.

Below you can find the code for a class CRoundedEditCtrl which can be used like a CEdit. It should be enough to add these files to you projects, include the header i.e. in the header of a dialog class where you want to use them and subclass your edit controls (this is i.e. done automatically if you use ClassWizard, just replace the generated CEdit in header to CRoundedEditCtrl).

The CRoundedEditCtrl is borderless, I hope this is ok, I found drawing a border in a nice way is difficult, tests I made always looked ugly. But as a goodie there's a SetColors function to change text- and background-color.

Hope this helps,

ZOPPO
RoundedEditCtrl.cpp
RoundedEditCtrl.h
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Starting up a Project

656 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