How to Use the Name Argument of an @...GET in Visual FoxProID: Q138780 3.00 WINDOWS
The information in this article applies to:
SUMMARYVisual FoxPro's Online Help for Controls and Objects states:
But it does not provide an example. This article will show how to
incorporate the NAME clause into a program with @...GETs.
MORE INFORMATIONWhen using the NAME clause, you can run the control's default methods and events, but you will not be able to write new code for any of methods or events. The only exception is for the WHEN and VALID events because the WHEN and VALID are clauses of the @...GET command. You are able to assign values to any of the objects Properties at runtime. An important point to remember is that Visual FoxPro creates a PageFrame and a Page to handle the READ level for any @...GET commands in a FoxPro 2.6 program. The page and its controls become active at the READ and terminate when the READ terminates. For more information on converting to Visual FoxPro see 'Converting from FoxPro 2.6' under Getting Started in the Using Visual FoxPro section of online Help.
Sample Code Showing How to Use the NAME ClauseDEFINE WINDOW mywin NAME MyWin; ACTIVATE WINDOW mywin
@ 3,5 GET a NAME Text1; @ 3,25 GET b NAME Text2;
@ 10,5 GET x Name Button1;
@ 10,25 GET y NAME Button2;
@ 20,15 GET z NAME Button3;
** The next four lines of code give the @...GETs for the text boxes
** a 3D look.
MyWin.PageFrame1.Page1.Text1.SpecialEffect = 0
MyWin.PageFrame1.Page1.Text2.SpecialEffect = 0
MyWin.PageFrame1.Page1.Text1.BorderStyle = 1
MyWin.PageFrame1.Page1.Text2.BorderStyle = 1
MyWin.Refresh()
MyWin.Caption = "Window Caption" && Sets the Title Bar Caption
MyWin.PageFrame1.Page1.Text1.Value = "Press Button 1"
** The buttons become part of a command group. The next line of
** code sets the focus to Button1.
MyWin.PageFrame1.Page1.Button1.Command1.SetFocus()
READ CYCLE RELEASE WINDOW mywin
Additional reference words: 3.00 VFoxWin
KBCategory: kbhowto
KBSubcategory: FxprgGeneral
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |