Solved

RichEdit Control

Posted on 2000-03-14
8
461 Views
Last Modified: 2013-11-20
Hi,

I am trying to use a RichEdit Control on my dialog because I need to change the edit controls background colour...

I'd like the control to be read only, right aligned text and in Upper case only. I have tried to set these properties when in the reseource editor. I found that the read only checkbox worked but it disables the ability to change the alignment and the Uppercase checkbox doesn't do anything...

Is there another way of setting these properties.. I have looked through all the methods on the control and can't find any. Also is it possible to change the font size of the text being displayed..

thanks in advance..
0
Comment
Question by:middlel
[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
  • 4
  • 3
8 Comments
 
LVL 4

Expert Comment

by:captainkirk
ID: 2616645
Did you check the "multiline" property?
0
 
LVL 4

Accepted Solution

by:
captainkirk earned 102 total points
ID: 2616665
Also you can set the font:

CFont f;
f.CreateFont(<set your params for the font in here>);
m_RichEdit.SetFont(); // m_RichhEdit is your control...


be sure to call AfxInitRichEdit() in your app's InitInstance()...
0
 

Author Comment

by:middlel
ID: 2616814
I have made sure that the control is intialised, you can always tell if AfxInitRichEdit() hasn't been called because the dialog does not display. :-)
I don't want the edit control to have multiple lines, but when I tried it made no difference.

However, when I unchecked the automatic horizontal scroll, and the multiple lines state was also checked, the edit control aligned properly ... weird..

I still haven't figured out how to get the edit to display UPPERCASE no matter what is entered??

I'll try the font stuff..

thanks

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:gelbert
ID: 2616835
Overwrite OnChar() and convert every character to upper case there
0
 
LVL 4

Expert Comment

by:captainkirk
ID: 2616838
I missed a point here - if the rich edit is read only, just setting the uppercase property is not going to work, because, that only converts typed-in text to uppercase. If you use SetWindowText(), you'll do the conversion yourself, maybe like a variant of this:

CString csText = _T("here's some lowercase text...");
csText.MakeUpper();

m_RichEdit.SetWindowText(csText);
0
 

Author Comment

by:middlel
ID: 2616891
I get passed the text from somewhere else and I thought it would be nice if when I Set the text it would automatically just convert it... ;-)

I'll just add a check to make sure that it is uppercase..

Cheers!

Emma
0
 

Author Comment

by:middlel
ID: 2619210
It all works great now!

thanks a lot..

Emma
0
 
LVL 4

Expert Comment

by:captainkirk
ID: 2620161
glad you're doing OK...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 112
Folder Comparison 12 55
Change to event 1 129
How do I get Window Title of all opened process? 4 39
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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