Freelance Writing Jobs | Today's Articles | Sign In

 
Browse Sections

Rich Textbox Control


RichTextbox1.SelBold=True
RichTextbox1.SelItalic=True

turn on the bold and italic attributes of the selected text. Again, if no text is selected, the attributes are set for the character at the current location of the pointer. By setting the character formatting properties accordingly, the user is in effect changing the style of the text he or she is about to type. To change the font and style of the selected text, use the properties SelFontName and SelFontSize. The following statements will render the selected text in Verdana font, 24 points:


RichTextbox1..SelFontName = "Verdana"
RichTextbox1..SelFontSize = 24

You must supply a font name that exists on the client computer, or a similar font will be substituted. As of now, it's not possible for VBScript to read the names of the fonts installed on the client computer and present them to the viewer to select one.

As you have realized, creating a functionalword processor based on the Rich Textbox control is quite simple. You must provide a convenient user interface that lets the user select text and apply attributes and styles to it, and then set the control's properties accordingly.

The copyright of the article Rich Textbox Control in VB Script is owned by Maxim Karetnikov. Permission to republish Rich Textbox Control in print or online must be granted by the author in writing.

Go To Page: 1 2

Articles in this Topic    Discussions in this Topic