Page 36 - Open Soource Technologies 304.indd
P. 36
Event Driven Programming
7. You have created an ActiveX control. The control needs to be hidden from the user at
runtime. Which of the following actions will ensure that the control is hidden at runtime?
(a) Setting the Visible property to False in the Initialize event of the control.
(b) Setting the InvisibleAtRuntime property to True.
(c) Call the InvisibleNow method of the ActiveX control.
(d) This cannot be done because ActiveX controlsin Visual Basic are always visible.
8. Which of the following statements is true about ActiveX controls?
(a) ActiveX controls can only be used from Web pages.
(b) ActiveX controls cannot contain other controls.
(c) ActiveX controls must be visible at runtime.
(d) An ActiveX control can read or save its properties from a persistent location.
9. Which statement is the best description of a Property Bag object?
(a) The Property Bag is a collection of the ActiveX control properties.
(b) Property Bag is an object used to read and write properties to a persistent location.
(c) A Property Bag is an array of properties of an ActiveX control.
(d) Property Bag is not a valid object type in Visual Basic.
2.6 Review Questions
1. If You have an ActiveX EXE program with a class declared as SingleUse. What effect could
this have on the memory of the computer when multiple clients access this object?
2. Have you ever created ActiveX controls? If so, what did they do?
3. Write the steps in Creating ActiveX Dll and Active Exe.
4. What is active? Why it is required in visual basic? Explain its usage.
5. Write the Steps in Creating an ActiveX Control.
6. What is the difference between ActiveX Exe and Dll?
7. Begin a new ActiveX DLL project in VB.
8. Describe how and why raising events are necessary when creating ActiveX controls.
9. Describe the facilities provided in Visual Basic that allow a UserControl to load and write
its properties.
10. How does the programmer prevent an ActiveX control from being visible at runtime?
11. Describe the role of the PropertyBag object.
12. What must you do to test your ActiveX control within Internet Explorer? What must you
do to test its behavior in another VB program?
30 LOVELY PROFESSIONAL UNIVERSITY