Creating textboxes during program execution 
Author Message
 Creating textboxes during program execution

Hi!

I'm trying to create a textbox in a method.  I'm using VFP 3.0.


TextBox NAME Txtbox1 --  but I can't access any of it's properties
(thisform.txtbox1.value returns nothing) and I can't click into it on
the form.

Is there any way to do this?  Also, is there any way to get a list of
active objects?  I tried AINSTANCE(aArray, "TextBox") but it returns 0.

Thanks!

--
Jeff Davidson

 Los Angeles, CA



Fri, 15 Feb 2002 03:00:00 GMT  
 Creating textboxes during program execution

Quote:

> Hi!

> I'm trying to create a textbox in a method.  I'm using VFP 3.0.


> TextBox NAME Txtbox1 --  but I can't access any of it's properties
> (thisform.txtbox1.value returns nothing) and I can't click into it on
> the form.

Check the 'Addobject' method.

WITH thisform
        .Addobject('MyName', 'TextBox')
        WITH .MyName
                .Top = 10
                .Left = 20
                ...
                * Other properties assigned here
                ...
                .Visible = .T.
        ENDWITH
ENDWITH


Quote:
> Is there any way to do this?  Also, is there any way to get a list of
> active objects?  I tried AINSTANCE(aArray, "TextBox") but it returns 0.

Try:

WITH thisform
        FOR nControl = 1 TO .ControlCount
                ? .Controls(nControl).name
        ENDFOR
ENDWITH

This will print a list of all controls added to the project (not just
text boxes).  Strictly speaking the active object is the object that
currently has focus of which there can be only one.

Quote:
> Thanks!

> --
> Jeff Davidson

>  Los Angeles, CA



Fri, 15 Feb 2002 03:00:00 GMT  
 Creating textboxes during program execution
Great!  What if I want to add an object from a class library?


Sat, 16 Feb 2002 03:00:00 GMT  
 Creating textboxes during program execution

Quote:

> Great!  What if I want to add an object from a class library?

Exactly the same.  Just use the name of your class instead of "TextBox"


Sat, 16 Feb 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Memorizing form configuration during program execution

2. Adding a field during execution without setup

3. modify the click event during execution

4. Textbox has no cursor during focus!!

5. ON KEY LABEL in program execution?

6. need to speed up program execution

7. stopping further execution of program

8. Pausing Program Execution

9. How to stop program execution when calling a new form

10. ICON not created during install of VFP application

11. No menu shortcuts created during app install

12. Program Hang During Printing of Reports (Foxpro 2.6)

 

 
Powered by phpBB® Forum Software