Solved

CRichEditCtrl cannot has the alphabet become uppercase

Posted on 2001-08-25
9
260 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
 
LVL 4

Expert Comment

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

-=- James.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now