Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  Component Development

Visual Basic Step-by-Step


Jay Massena and Douglas Hodges

Updated: February 12, 1997

DownloadDownload this document in Microsoft Word (.DOC) format (zipped, 3.28K).

Summary

This document is a step-by-step tutorial for creating the Bgsound design-time control using Microsoft® Visual Basic® version 5.0.

Contents
Step 1: Create ActiveX Control project
Step 2: Use the VB ActiveX Control Interface Wizard to configure your control
Step 3: Add IActiveDesigner interface reference to project
Step 4: Implement IActiveDesigner interface



Create an ActiveX Control

Step 1: Create ActiveX Control Project

A. Create new ActiveX control project using File.New Project and choose ActiveX Control at the type.

B. Add label control to the UserControl (ActiveX control) you just created.

C. Set properties on the label control.

Set label control Name property to "lblSource"
Set label control Caption property to "[No Sound Source]"

D. Name the project and control.

Project name = web
Control name = bgsound

E. Save the project and name the project file "web.vbp"; name the control file "bgsound.ctl."

TopBack to top

Step 2: Use the VB ActiveX Control Interface Wizard to Configure Your Control

A. Use the Add-Ins.ActiveX Control Interface Wizard to launch the wizard.

B. Remove default events, props, and methods that have been added.

C. Add the following properties. (Note: Repeat is used instead of Loop because Loop is a VB keyword)

Source
Repeat

D. Point the Source property to lblSource.Caption property.

E. Set the Repeat datatype to integer and the default to -1.

F. Finish wizard.

TopBack to top

Add Design-time Control Support

Step 3: Add IActiveDesigner Interface Reference to Project

A. Add reference to the "Microsoft Web Design-time Control Type Library."

Open Project.References and scan the list of available references making sure that the Microsoft Web Design-time Control Type Library is checked if present. If the library is not listed, then browse to the c:\program files\design-time control sdk\samples\vb\common directory (if you used the default install location) and add webdc.tlb as a project type reference. This automatically checks the library in Project.References and includes it in your project.

TopBack to top

Step 4: Implement IActiveDesigner Interface

A. Add IProvideRuntimeText interface definition

Implements IProvideRuntimeText

B. Implement IProvideRuntimeText_GetRuntimeText

Dim strText As String
Dim strQuote As String
strQuote = Chr$(34)
strText = "<BGSOUND SRC=" & strQuote & lblSource.Caption & strQuote 
strText = strText & " LOOP=" & strQuote & Repeat & strQuote &  ">"
IProvideRuntimeText_GetRuntimeText = strText

C. Compile web.ocx


Did you find this article useful? Gripes? Compliments? Suggestions for other articles? Write us!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site