in application have custom control implements syntax highlighting via scintilla.dll.
there sorts of codes setting style of text in control.
however, i've searched , searched , can't figure out how center-align text in control.
what's scintilla code center-aligning text style?
there no "center-align" command in scintilla.
here do, however, center text:
- fetch text control
- know style being used
- use
textwidth
(2276
) figure width of text using style - use controlwidth /2 - textwidth /2 figure location of left margin
- use
setmarginleft
(2155
) move left margin
note default style 32
.
you'll have figure code update location every time, however, maybe via callback function.
in autohotkey, this:
guicontrolget, editor guicontrolget, editor, pos textwidth := hwndeditor.2276(32,editor) setplace := (editorw /2) - textwidth /2 hpeditor.2155(0,setplace)