FP97: Sample Script to Scroll Page in Marquee Control (190953)



The information in this article applies to:

  • Microsoft FrontPage 97 for Windows with Bonus Pack

This article was previously published under Q190953

SUMMARY

You can use the Marquee control to add a dynamic look to your Web pages. This article provides sample code for using a control that scrolls a separate page within the current page and creates two buttons that allow you to control the scrolling speed of the marquee.

NOTE: You can combine ActiveX controls to add greater functionality to your Web pages than would be possible with a single control.

MORE INFORMATION

WARNING: ANY USE OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Use the following steps to create a control that scrolls a separate page and uses two buttons to control the scrolling speed of the marquee:
  1. Start FrontPage Editor and open a Web page.
    • On the Insert menu, point to Other Components and then click ActiveX Control. Perform the following steps:
      1. From the Pick A Control list, click MarqueeCtl Object.
      2. In the Name box, type the name you want. For example, type Marquee.
      3. Click Properties.
      4. In the Object Parameters dialog box, click Add.
      5. In the Name box, type szURL. Under Value, in the Data box, enter the following Uniform Resource Locator (URL):
      6. Click OK two times.
      7. In the ActiveX Control Properties dialog box, click Extended.
      8. Click Add.
      9. In the Name box, enter TYPE. In the Value box, type application/x-oleobject. Click OK.
      10. Click OK two more times.
    • On the Insert menu, point to Form Field, and then click Push Button.
    • Right-click the form field and then click Form Field Properties on the menu that appears. In the Form Field Properties dialog box, follow these steps:
      1. In the Name box, type BtnFast.
      2. In the Value/Label box, type Fast.
      3. Click Normal.
      4. Click OK.
      5. Repeat steps b and c.
      6. In the Name box, type BtnSlow.
      7. In the Value/Label box, type Slow.
      8. Click Normal.
      9. Click OK.
    • Right-click the form area, and then click Script Wizard on the menu that appears. Perform the following steps:
      1. In the Event pane, double-click BtnSlow and then click onClick.
      2. In the Action pane, double-click Marquee, and then double-click ScrollDelay.

        The following code appears in the Script pane:
                     Sub BtnSlow_Onclick
                     Marquee1.ScrollDelay
        										
      3. Click immediately after the "Marquee1.ScrollDelay" code and type =200. Your code should look like this:
                     Sub BtnSlow_Onclick
                     Marquee1.ScrollDelay=200
        										
      4. In the Event pane, double-click BtnFast and then click onClick.
      5. In the Action pane, double-click Marquee, and then double-click ScrollDelay.

        The following code appears in the Script pane:
                    Sub BtnFast_Onclick
                    Marquee1.ScrollDelay
        										
      6. Click immediately after the "Marquee1.ScrollDelay" code and type =0. Your code should look like this:
                    Sub BtnSlow_Onclick
                    Marquee1.ScrollDelay=0
        										
      7. Click OK.
When you view the page in a Web browser, the Microsoft World Wide Web home page will scroll within the current Web page.

Modification Type:MajorLast Reviewed:8/10/2001
Keywords:kbinfo KB190953