Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 4 Jahren, 8 Monaten
Letzter Beitrag:
vor 4 Jahren, 8 Monaten
Beteiligte Autoren:
RAUL2, Al

[WD 15] RTF editbox looses its properties

Startbeitrag von RAUL2 am 30.04.2013 20:31

Hello guys.

I have a simple RTF editbox on a window. If I set the font name and color (for instance) with the toolbar before I start writing, and then, I write something, the text is properly formated. But, if I clear the editbox with edtSomeText= "" in a procedure, the font name and color is reseted to the ones defined in the Style tab of Describing... window.

Have you any idea about how to keep the properties set by me when the control is cleared? Any workaround would be useful.

Regards.

Antworten:

Hello Raul2

I think you might be able to retrieve enough information from the various ..font attributes of the control to be able to create a font that you could then apply back to the control

Prior to issuing your edtSomeText= "" command or maybe in the WhenModify() event

MyFontName is string = EditControl..font
MyFontSize is int = EditControl..FontSize
MyFontBold is boolean = EditControl..FontBold

MyEditControlFont is font
MyEditControlFont = FontCreate(MyFontName ,MyFontSize,MyFontBold)
EditControl..font = MyEditControlFont

I haven't tried this, but it might work

It maybe that you can retrieve the entire set of attributes as..
MyEditControlFont is font
MyEditControlFont = EditControl..font
edtSomeText= ""
EditControl..font = MyEditControlFont

Regards
Al

von Al - am 01.05.2013 00:07
Thank you Al. I'll try that and let you know. I have used font type variables before, in static RTF controls, but didn't come to mind now. It's a good idea.

Regards.

von RAUL2 - am 01.05.2013 00:17
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.