Site hosted by Angelfire.com: Build your free website today!

Print and Style Form

 

Okay, this has four new things to teach you: how to print, bold, italic and underline text. It’s all fairly easy if you were paying attention and doing the other programs.

 

1.)   First you will need three check boxes, a label and two command buttons.

These will be named:                                      The captions can be:

lblStyle                                                      Style

                           chkBold                                                     Bold

                           chkItalic                                                     Italic

                           chkUnderline                                               Underline

                           cmdPrint                                                    Print  

                           cmdDone                                                    Done

Yes that seems repetitive, but I like to be predictable.

 

2.)   Next you want to start the code:

All code has a pattern, which I hope to god you figured that out already... anyway, all code has patterns and this is no different.

        

                  Private Sub chkBold_Click()

                           If chkBold.Value = vbChecked Then

                                    lblStlye.Font.Bold = True

                           Else

                                    LblStyle.Font.Bold = False

                           End If

                  End Sub

 

For the other two you do the same, except you place in Italic and Underline where Bold is. The print command is about a millimetre off as easy as the Done command.

 

                  Private Sub cmdPrint_Click()

                           Me.PrintForm

                  End Sub

 

Was that easy? Yes? Well, I expected something like that. I hope that you keep remembering this stuff... you’ll notice that I only wrote the code box once then told you to go at it, and I didn’t even write down the code to exit the program. But, damn, if you don’t know it you either have a short memory or no memory... Or you didn’t do it.

 

 

Okay, that was the Print and Style form I hope that you learned it and didn’t just write the entire thing out, hope you can do it again later!

 

Back

 

Home

 

Next Exercise