A rich text control can display, as you might expect, rich text. Rich text is a special format used to create Microsoft hypertext documents, such as Windows help files, that contain jumps from page to page or topic to topic. In particular, rich text can include underlined text, double-underlined text, hidden text, footnotes, and more. Of course, a rich text control can also display standard text, and we'll use it for that purpose here. We install a rich text control like this in our Web page, giving it the ID RichText1:
<HTML>
<HEAD>
<TITLE>OCX Control Page</TITLE>
</HEAD>
<BODY LANGUAGE = VBScript ONLOAD = "Page_Initialize">
<CENTER>
<H1>OCX Control Page</H1>
</CENTER>
.
.
.
<!- RichText>
<PRE>
--> RichText: <OBJECT CLASSID="clsid:3b7c8860-d78f-101b-b9b5-04021c009402"
HEIGHT=40 WIDTH=300 ID=RichText1></OBJECT>
</PRE>
.
.
.
Our rich text control appears in Figure 6.4. We can place text in the control by setting its Text property. For example, we can have the rich text control display the text "Hello World!" when the user clicks the up spin button:
<SCRIPT LANGUAGE = VBScript>
--> Sub SButton1_SpinUp
--> RichText1.Text = "Hello World!"
--> End Sub
</SCRIPT>
</BODY>
</HTML>
Now let's move to the last of the ActiveX controls we'll see in our overview: progress bars.