How can I dynamically change alignment of text in edit control?
Some people say "Use SetWindowLong". But it doesn't seem to work. Can you show some portion of code, please?
Posted on 2003-08-23 06:52:11 by SolidCode
I did a handful of test, and your right. The set window long *does* update the flags accordingly for the window styles of the edit control, however, the control itself is not notifided in anyways of the change. To my knowledge there is no edit message to do this.

My only suggestion is not a clean solution:

    [*]Hide the current edit window
    [*]Create a new edit window with the new styles
    [*]Copy all the data to the new edit window
    [*]Show the new edit window
    [*]Destroy the old edit window

    Wish I could help more on this.... :me shrugs:

Posted on 2003-08-24 00:30:40 by NaN
Well, I guess I'll do this:
I will create three windows (for each alignment)
I'll have to set all the options (font, undo, text limit etc.) for each
One will be visible. It has the text too.
The others are hidden and have no text.
When switching between alignments I take all the text from the current (visible) control,
clear it,
set text to the other control,
show it,
hide old control.

Or I can just sigh and start learning rich edit.
Posted on 2003-08-26 10:25:42 by SolidCode
Or write your own custom Edit control ;)
Posted on 2003-08-26 17:47:09 by NaN
As i told you last time you asked this question, it does not work on a window that is already created, you need to destroy and recreate the window. Unless you do as NaN suggested and write your own edit control.

But of course, you *are* entitled to a second opinion :)
Posted on 2003-08-27 00:54:24 by sluggy