Hints: Program 7
Hints
and Extra Credit:
Program 7
- The Working Model edition of VB will not
support the creation of ActiveX
controls, you must come to the lab at
NKU to complete the last assignment.
- Use the steps (1-7) on page VB 7.19 - VB 7.21 for the
Buttons property but substitute for buttons your 3
properties Caption,
Interval,
and FontSize; you will not have the
Buttons or Action property used in the chapter in your
Flash Label.
- Remember to use the proper prefixes for
all your control names for all controls found on both the
ActiveX control (FlashLabel) and the testing project!
- Be sure to use the Hint: in your
book at the top of page VB 7.69 to make the label flash,
this code goes in the tmrFlash_Timer event of the
ActiveX control.
- Use the following code in the Resize event
of the UserControl to cause the constituent label control
to maintain the same size as the UserControl when its
borders are dragged to resize the control when placed
into a new project using the
ActiveX control.
lblFlash.Move 0, 0,
ScaleWidth, ScaleHeight Review
the boldfaced parameters provided by Visual Basic when
typing the statement in the code window to help
understand how the statement works or use the VB Help
system.
- Do not put any command buttons on
the
ActiveX control itself, it should only contain two
controls a label and a
timer control. The command buttons
for Caption,
FontSize,
and Interval
go into the application
that tests the ActiveX Flash label.
- Use the InputBox$ function to
prompt the user for new values for the three new
properties (Caption,
Interval,
and FontSize) added to the
UserControl when testing the FlashLabel
ActiveX control using the command buttons. (run the Web Page Program)
- Before using the command buttons
in the test
application to change the three properties at run-time,
check out the new properties of the Flashlabel at design-time
by clicking on it in the test project going to the
Properties Window and changing the values for Caption,
FontSize, and
Interval. If there is any problem putting
in new values, you must go back and check the FlashLabel
ActiveX control's Get,
Let,
ReadProperty, and
WriteProperty procedures to set-up the property in error
correctly!
- Lab Users:
Do not compile the
ActiveX control (Flashlabel) into an .ocx file this will cause
the control to be added to the System Registry
of the machine. To test the FlashLabel create the
ActiveX control first and save it to your floppy. Click the File
menu then click the Add Project ...
item, double-click Standard EXE icon to create a Visual
Basic project in which to test your FlashLabel. Add the
ActiveX control (FlashLabel) and 3 command buttons
to
your standard Visual Basic test project. Before
running the test project right-click on the project
window while pointing to the 2nd Project (Standard VB
Project) icon, select Set As Start Up
from the popup menu. Click the disk icon
on the toolbar (Save Project
Group ToolTipText will appear) save the test form to the
floppy as TestFlashLabel in the Save File As dialog box,
save the project as TestFlashLabel in the Save Project As
dialog box, use the group name TestFlashLabel in the Save
Project Group As dialog box. You are now ready to test
the FlashLabel, click the start button on the toolbar.
- For Extra Credit: Check the ranges for the
Interval
and FontSize
values as indicated by the program on Web
page. A loop structure needs to be created to allow the user to keep
entering values until the correct range of values is entered.
- For Extra Credit: Add additional properties to the
FlashLabel that you find useful. (AutoSize is nice, but a
little tricky, see if you can make it work just for fun)
|
Assignments |
More Extra Credit |
Outputs |
Requirements |