Flat edit control


Download the source

This took about 20 minutes to create. I saw Kirk Stowell’s CFlatComboBox class and decided it needed a similar Edit control
I actually made the code look similar to Kirks to keep things simple if you need to edit the code in both classes for your purpose

Pretty neat looking edit control actually, i wonder why i never saw this sooner

Information

To Use this class :

Create a new class member of type CFlatEdit for an edit control in your dialog
Make sure to have #include “FlatEdit.h” at the top of that dialogs .h file
Thats It!

NOTE: For best appearance, under the properties for your edit control, deselect ‘border’ and select ‘static edge’

For the CFlatEdit class to appear in the new member variable dialog for an edit control, you must rebuild the class information
You can do this by deleting the .clw file in your project directory. When you go into class wizard, it will ask you to rebuild your class info from files.

Select all the c, cpp, and h files in that directory and add them all

You can change the m_bDrawGripper and m_bDrawSeperator values to true to use the seperator and
gripper features. You can also set the left edit margin using SetIndent(int)

And one more kewl feature: use m_bFlatStyle to change the style.
If its true (default), it will draw the control as a typical flat control.
If its false, it will be drawn with a thick black border (Like that around a
flat Checkbox)

Last updated: 17 October 1998

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read