Click to See Complete Forum and Search --> : aligning text + more


January 18th, 2000, 05:57 PM
how do I align text within a textbox during run time? To the left, center, and right....with only selected text (.seltext)?
Also, how can I change the font to bold, italic, strikethru, and underline, by toggling? I tried this:


text1.fontbold = not fontbold




but it turns the font to bold, but doesn't make it not bold... How can I make it so that selected text will become bold, underline, strikethru, italic, and if there is no selected text, any text typed after that is that kind?

Rippin
January 18th, 2000, 06:59 PM
You need to use a Rich-TextBox (RICHTXT32.OCX). The Rich-TextBox has properties and methods for formatting,aligning,printing,saving,etc. (e.g. RichTextBox1.SelColor = vbRed). A standard VB TextBox will not support formatting of individual segments of text.