简体   繁体   English

使用编辑控件样式进行丰富的编辑

[英]Using edit control styles for rich edit

I've got a Rich Edit Control, created like this, 我有一个如此创建的Rich Edit控件,

            box = CreateWindowEx(
                0, 
                MSFTEDIT_CLASS, 
                L"Type here", 
                WS_VISIBLE | WS_CHILD | WS_TABSTOP | SS_OWNERDRAW,
                position.x,
                position.y,
                dimensions.x,
                dimensions.y,
                owner,
                0,
                hinst,
                0);

The documentation indicates that ES_LEFT will left-align the text, which is what I'm looking for. 文档指出ES_LEFT将使文本左对齐,这正是我要的内容。 But when I add it to the list of styles, nothing happens. 但是,当我将其添加到样式列表中时,什么也没发生。 How can I set this edit control style? 如何设置此编辑控件样式?

就像您在CreateWindowEx()的第四个参数中使用任何其他样式一样:

WS_VISIBLE | WS_CHILD | WS_TABSTOP | ES_LEFT
#define ES_CENTER   1
#define SS_OWNERDRAW 0xd

it's microsoft BUG: unfortunatly ES_CENTER is included in SS_OWNERDRAW . 它是Microsoft的BUG:很遗憾, ES_CENTER包含在SS_OWNERDRAW

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM