Condividi tramite


Visual Basic Concepts

ActiveX Controls

ActiveX controls, formerly called OLE controls, are standard user interface elements that allow you to assemble forms and dialog boxes rapidly. ActiveX controls also bring the Internet alive, adding compelling new functionality to World Wide Web pages.

Visual Basic has always featured a variety of controls that you could use in your applications. Now you can create your own controls, for use with Visual Basic and other development tools. With ActiveX controls, your investment in Visual Basic carries forward to the Internet.

Designing an ActiveX control can be as easy as designing a Visual Basic form — you can use familiar Visual Basic graphics commands to paint your control, or create a control group using existing controls.

ActiveX controls can be debugged in process, so you can step directly from the code for your test form into the code for your ActiveX control project.

You can add data-binding to your Visual Basic ActiveX control, so that a user can easily bind the individual fields within the control to the appropriate fields in a database or other source of data. You can also use data-binding to create an ActiveX control that other controls can bind to, similar to the Visual Basic Data control.

Visual Basic makes it easy to create polished ActiveX control packages by adding property pages, named constants, and events to your controls.

You can compile your ActiveX controls directly into your application’s executable, or into .ocx files that can be used with development tools such as Visual Basic and Microsoft Visual C++, with end user products such as Microsoft Office, and on the Internet.

"Creating an ActiveX Control" offers a quick step-by-step introduction to control creation — including the radical idea of running code at design time to debug your control’s design-time behavior.

For More Information   "Building ActiveX Controls" and "Creating Property Pages for ActiveX Controls" discuss control creation issues in depth. "General Principles of Component Design" and "Debugging, Testing, and Deploying Components" also contain many topics of interest to control designers.