Diese Seite mit anderen teilen ...

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

[WD12] Insert bold text into a control

Startbeitrag von Al am 30.08.2009 12:00

Hello All

I need to construct a string with some text in bold + information from an RTF control and I cannot make the text bold. I have tried from the examples using GFontBold but it doesn't work as I expected. Even the example in the Help does not work as a text string.

I think this is how the code should be
LOrigInfo is string = RTFInsert(NoSpace(IMSHD0.Description)+CR,gFontBold()+"Original Information:"+CR+"Procedure Name"+CR,1)

This should give me in bold text:
Original Information:
Procedure Name
The rtf text should then appear under that heading

What I get is not bold and shows the escape symbol plus the letters "PG"
Esc + PG + Original Information:
Procedure Name
my RTF text then appears here.

Does any one have an example of how the code should be written please



Hi Al,

RTF is a markup language very different to HTML. http://en.wikipedia.org/wiki/Rich_Text_Format Single symbol characters can take up to 100 characters!

I experienced similar, seemingly insurmountable problems with generating RTF text programmatically. At last, I solved those problems by 'writing' to a hidden RTF-Text using SendKey(..) .. this way I could make a small text editor for use of a dozen languages and character sets at the same time. This was for printing labels with usage instructions in several languages.

Maybe, you could simulate writing in bold / normal to an edit control and copy the contents of the edit control to the caption of the button?

Kind regards,

von Jimbo - am 30.08.2009 12:44
Hello Guenter

Thanks for the suggestion, it got me thinking again. I was getting bogged down trying to get the GFontBold() command to work, because it seemed like it should be the correct method.
I modified your idea and the solution is relatively straight forward.
Create a number of RTF statics, type in the text with RTF attributes as the captions for the static and then use the static..caption to introduce the text where I need it.


von Al - am 30.08.2009 13:50

Hi Al,
that's fine!

von Jimbo - am 30.08.2009 14:11
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.