slender_bamboo

I have a dialog with a text control.

It is basically working, but I want to make to changes to it, and I don't see these options as part of the standard properties:

- Support for Text Wrap.

I have a Horizontal Scrollbar, but I'd prefer not to have that and just wrap text.

When I turn the scrollbar off, it doesn't wrap.

- Support for Ctrl-A Select All

Select All is available from the popup right-click menu, but I would like to have it as an accelerator key.

Ctrl-C and Ctrl-V are already working. How can I get Ctrl-A



Re: Visual C++ General VS 2005 C++ Text Control Settings

Hi,

As i prefer better use owner drawn text control. and to activate Ctrl+A as acclerator, add accelerator resource in resource file. It may work






Re: Visual C++ General VS 2005 C++ Text Control Settings

Simple Samples

All of that can be done using the dialog editor of the resouces editor.






Re: Visual C++ General VS 2005 C++ Text Control Settings

slender_bamboo

I am using the dialog editor and don't see either as properties that can be set.

I think by subclassing the CEdit control that I can capture the keydown events and then get select all to work for the Ctrl-A key. Ctrl-C and Ctrl-V already seem to be baked into the CEdit control. I don't understand why Ctrl-A was left out.
I have some code for this and will be trying that.

As for text wrap, I am not able to find a property for CEdit to handle it, which is disappointing.




Re: Visual C++ General VS 2005 C++ Text Control Settings

Simple Samples

Sorry, I forgot that word wrap is not a property directly. Look at the SuperPad sample program; it has an option for toggling word wrap on and off. That will show what you need for word wrap. Or look at the documentation; I assume the documentation will specify how to get word wrap.

Accelerator keys are definitely supported in the resources. You are doing things the hard way. The accelerator table in the resources makes it very easy to specify accelerator keys. I am not sure but you might need to also use an override of CDialog to process the accelerator keys for your dialog. See my Processing Keyboard Messages CodeGuru article for a description of how to do that, except I don't know if that is still necessary. MFC might have been enhanced since then so that perhaps some or all of that might not be needed.