Solved

CRichEditCtrl cannot has the alphabet become uppercase

Posted on 2001-08-25
9
279 Views
Last Modified: 2013-11-20
i put a richeditctrl in dialog on resource editor.
i set the UPPERCASE style for the richedit control under its property dialog.
   however, what i input the in the rich edit control didn't turn out to be automatically converted to uppercase
what is wrong?
0
Comment
Question by:orange_juice
  • 3
  • 3
  • 3
9 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 50 total points
ID: 6425599
I assume that your ptoblem is that when you set the window text, it remains lowercase or mixed case.

The UPPERCASE flag only works to convert text that gets typed by the user.

So, simply do something like:

   m_sText.MakeUpper();

before the text gets placed into the control.

-- Dan
0
 
LVL 1

Author Comment

by:orange_juice
ID: 6427633
Yes, i agree with your point : )
luckilly, i just want to convert text gets typed by user...
but, how to get those text prior to be placed into control?
i mean, how to get m_sText

thank you
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6428184
You cam place text into a CRichEditCtrl by using SetWindowText() or by using the ClassWizard to create a CString type variable for the control (name it m_sText).  Then when you open the dialog box use code like:

CMyDlg dlg;
dlg.m_sText="Here is some text for the Rich Edit!";
dlg.DoModal()

There are other ways to get text into the control, these are the easy ways.

-- Dan
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Expert Comment

by:jtwine100697
ID: 6429192
Is this the same problem that I already answered for you?

-=- James.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6443940
hi orange_juice,
Do you have any additional questions?  Do any comments need clarification?

-- Dan
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 6444688
(I am not sure what the OP is trying to do with this pseudo-duplicate question.)

The problem is that the Rich Edit controls ignore the ES_UPPERCASE and ES_LOWERCASE styles...  However, Rich Edit 3.0 supports the EM_SETEDITSTYLE message, which can be used to obtain similar functionality.

-=- James.
0
 
LVL 1

Author Comment

by:orange_juice
ID: 6455304
oops, owing to the weird refresh problem of experts-exchange, i accidentally thought that my first q can't get through, so i duplicate one
sorry for the confusion....
0
 
LVL 1

Author Comment

by:orange_juice
ID: 6455329
oops, i overlooked something
  actually, i mean when i type into the richedit control, and not try to set-text into it.
  anyway, this is a new knowledge to me :)

James:
  yes, it is the duplicate answer

Dan,
  thanks
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 6456940
> actually, i mean when i type into the richedit control,

Then you already know why the styles do not work as expected, and a possible solution, from the information I gave you on your original posted question.

-=- James.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 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