Wednesday, December 17, 2008

Thursday December 18: Building on what we've already done PART ONE

Hey there hi there ho there!


Today, we will continue with our work with classes. We will build on the project we worked on yesterday, adding several modifications to it. After we have done that, I will ask you to do some exploration of what we have learned on your own. Here is what we will be adding:

A) You will make your label -- which is based on the Class called "RainBowLabel" -- do something by calling a SUB inside of a module. Then, I will show you how to do something else from within that same SUB procedure, and apply it to a control --in this case a textbox-- that you place on your form the way you've always done it: by just dragging it on to the form!

B) You will make a second Class, and use the "Layout" event to make that Class look a certain way

C) You will will use the Class that you made yesterday to create an object from the Class you just made in B), and then put that new object into your form.

HERE IS HOW YOU DO ALL THAT:

1) Re-open the project from yesterday

2) Add a new Class and name it "RainBowCalling"

3) Set up a SUB procedure in that module called
Public Sub PopItUp( )

4) Inisde that SUB, just put this one line of code:
MsgBox("You dont taste one bit like skittles!!")


5) make sure that you "CALL" that SUB from inside the Class "RainBowLabel" by
getting back into the code for the RainBowLabel class, getting into its event list from the left hand pulldown, then look for the "Click" event in the right hand pulldown

6) inside the new SUB that jumps up out of nowhere, put in this line of code"
MsgBox("You dont taste one bit like skittles!!")


7) Run the program, and click on your label to see if it works

When everybody has that done, we'll go onto Part Two

Cheers,
Mr. L

No comments: