Solved

CRichEditCtrl cannot has the alphabet become uppercase

Posted on 2001-08-25
9
272 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 78
iSeries DB2 Query 2 95
How to determine file rename from EventLog ? 2 49
conditional code and condition difference 9 83
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.

823 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