VB Graph Custom Control: DataReset Property Resets to 0 (Zero)

Last reviewed: June 21, 1995
Article ID: Q84058
The information in this article applies to:

- Professional Edition of Microsoft Visual Basic for Windows,

  versions 2.0 and 3.0
- Microsoft Professional Toolkit for Microsoft Visual Basic programming
  system for Windows, version 1.0

SUMMARY

When you assign a value to the DataReset property of the Graph version 1.2 custom control, the value of DataReset always resets to 0 - None. This is by design. Although DataReset is listed in the Properties box, it also has characteristics of a method. A value assigned to DataReset is transient, which means that it causes a one-time action and then resets to 0 - None.

MORE INFORMATION

In Visual Basic for Windows, a property is an attribute of the control that you can set to define one of the object's characteristics. DataReset is a property because you can set its value which, depending on that value, defines one or more of the Graph control's characteristics. Because it defines a Graph's characteristics by resetting the chosen property array to its default values, DataReset is found in the Properties list box.

A method in Visual Basic for Windows behaves similarly to a statement in that it always acts on an object. DataReset can also be considered a method because it does perform an action on the graph. Namely, it resets the chosen property array to its default values. DataReset performs the assigned action as soon as its value does not equal 0. If it retained its assigned value, it would continually generate an endless loop and lock the system. To prevent this from occurring, it is automatically reset to 0 - None upon the first execution of its call.

The example below demonstrates the behavior of DataReset.

Example

1. Run Visual Basic for Windows, or from the File menu, choose New
   Project (press ALT, F, N) if Visual Basic for Windows is already
   running. Form1 is created by default.

  • From the File menu, choose Add File. In the Files box, select the GRAPH.VBX custom control file. The Graph tool will appear in the Toolbox.

  • Add a Graph control (Graph1) to Form1.

  • In the Properties list box, select the DataReset property. The value that appears in the Settings box will be 0 - None.

  • Change the value of DataReset to a number between 1 and 9. The values 1-9 refer to Graph property arrays that can be reset by using the DataReset property.

  • Graph1 will update to display the default values in the property array you chose in step 5.

  • In the Properties list box, select DataReset. The value of DataReset is 0 - None. It did not retain the value from step 5.


  • Additional reference words: 1.00 2.00 3.00
    KBCategory: kbprg
    KBSubcategory: PrgCtrlsCus


    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: June 21, 1995
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.