04.08.2013 Views

Chapter 10 Using VFP's Object- Oriented Tools - dFPUG-Portal

Chapter 10 Using VFP's Object- Oriented Tools - dFPUG-Portal

Chapter 10 Using VFP's Object- Oriented Tools - dFPUG-Portal

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

286 The Fundamentals of Visual FoxPro 6.0<br />

Control Property/Method Description<br />

Forms<br />

(continued)<br />

Load()<br />

Destroy()<br />

See Listing <strong>10</strong>.1 at the end of this table.<br />

*Hide the form so it<br />

*appears to go away<br />

*faster.<br />

This.Hide()<br />

Labels AutoSize = .T.<br />

BackStyle = Transparent<br />

Caption = “lbl”<br />

Command Caption = “cmd”<br />

Buttons<br />

Page Frames ActivePage = 0<br />

PageCount = 0<br />

All datarelated<br />

controls—text<br />

boxes, check<br />

boxes,<br />

combos, lists,<br />

etc.<br />

Text and Edit<br />

Boxes<br />

TabStyle = Nonjustified<br />

AnyChange (custom method) Add the following code to the InterActiveChange and<br />

ProgrammaticChange events:<br />

This.AnyChange()<br />

Why? So you can centralize code that should be<br />

called if either the InterActiveChange event or the<br />

ProgrammaticChange event is called. You can still<br />

put code that is specific to either InterActiveChange<br />

or ProgrammaticChange in the respective method,<br />

but this technique saves a lot of redundant code.<br />

Valid() See Listing <strong>10</strong>.2 at the end of this table.<br />

Validation (custom method) This method is called from the Valid() method.<br />

IntegralHeight = .T.<br />

SelectOnEntry = .T.<br />

Valid()<br />

Check Boxes AutoSize = .T.<br />

BackStyle = Transparent<br />

Caption = “chk”<br />

Valid()<br />

Option Groups OptionGroup AutoSize = .T.<br />

BackStyle = Transparent<br />

ButtonCount = 12<br />

Valid()<br />

Option groups have buttons that are not already<br />

subclassed and can’t be subclassed. So ignore the<br />

Option Button class.<br />

I create an Option group with a dozen option buttons<br />

that are already preconfigured. Then I set Enabled<br />

and Visible to False and resize the option group. That<br />

way, the buttons have the properties already.<br />

Option button properties:<br />

AutoSize = .T.<br />

Caption = “1” through “12”<br />

List Boxes IntegralHeight = .T. List boxes don’t get a Valid() because the Valid() fires<br />

each time you move the highlight in the list box.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!