RE: Programatically placing text boxes on a form - continued

2023-10-30 Thread juergen
This one even provides a working version :=)

***
nStartRow = 10
nStartCol = 10

For nCol = 1 To 4
  For nRow = 1 To 10
cTextBoxName = "TextBox" + Trans(nCol) + Trans(nRow)
Thisform.AddObject( cTextBoxName, "textbox")

With Thisform.
  .Left= nStartCol + ((nCol-1) * 110)
  .Top = nStartRow + ((nRow-1) *  24)
  .Width   = 100
  .Value   = "Cell " + Trans(nCol) + ", " + Transform(nRow)
  .Visible = .T.
Endwith
  Endfor
Endfor
***





___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/000d01da0b74$16bc1df0$443459d0$@wondzinski.de
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: Programatically placing text boxes on a form - continued

2023-10-30 Thread Frank Cazabon

Try this:

FOR i = 1 TO 4
    FOR j = 1 TO 10
    m.lcTextBoxName = "TextBox" + LTRIM(STR(i)) + LTRIM(STR(j))
    THISFORM.ADDOBJECT( m.lcTextBoxName, "textbox")

    oTextbox = EVALUATE( "Thisform." + m.lcTextBoxName)
    WITH oTextbox
        .NAME = "TextBox" + LTRIM(STR(i)) + LTRIM(STR(j))
        .LEFT = (j - 1) * 10
        .TOP = (i - 1) * 20
        .WIDTH = 100
        .HEIGHT = 20
        .VALUE = "Data for cell " + LTRIM(STR(i)) + ", " + 
LTRIM(STR(j))

        .VISIBLE = .T.
    ENDWITH
    ENDFOR
ENDFOR

Frank.

Frank Cazabon

On 30/10/2023 2:23 pm, Joe Yoder wrote:

Tracy,
Thanks for the help - the first line makessence and executes just fine but
the
"oTextbox = evaluate" line errors with variable "TEXTBOX11" is not found.
Do I need something in my code or on my form to have this work properly?

BTW - sorry for not doing this as a reply.  My email no longer gets posts
from replies to my emails so I need to get them from .the archive.  I
reported the problem to Mailman at the leafe.com but have not
received a response.

Thanks again,
Joe


--- StripMime Report -- processed MIME parts ---
multipart/alternative
   text/plain (text body -- kept)
   text/html
---


[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/9a57b610-5634-588c-34f2-ca84e96e4...@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Programatically placing text boxes on a form - continued

2023-10-30 Thread Joe Yoder
Tracy,
Thanks for the help - the first line makessence and executes just fine but
the
"oTextbox = evaluate" line errors with variable "TEXTBOX11" is not found.
Do I need something in my code or on my form to have this work properly?

BTW - sorry for not doing this as a reply.  My email no longer gets posts
from replies to my emails so I need to get them from .the archive.  I
reported the problem to Mailman at the leafe.com but have not
received a response.

Thanks again,
Joe


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/cabqednvyz4wm27coo7wmftr6qlt57tl0q3tx+t1ffeag_ef...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: Programatically placing text boxes on a form

2023-10-30 Thread Eric Selje
Along these lines, if you haven't checked out the Dynamic Forms
 project on VFPx, that makes
programmatically creating forms MUCH easier.

E


On Mon, Oct 30, 2023 at 5:19 AM Tracy Pearson  wrote:

> The textbox needs to be added with a method on the form.
>
> thisform.addobject( "TextBox" + LTRIM(STR(i)) + LTRIM(STR(j)),
> "textbox")
>
> oTextbox = evaluate( "TextBox" + LTRIM(STR(i)) + LTRIM(STR(j)))
>
>
> HTH,
> Tracy
>
>
> On October 29, 2023 11:43:13 PM EDT, Joe Yoder  wrote:
> >I know I had code years ago that did this but it apparently got mangled
> >during computer transitions.  The code below runs in the load event of  a
> >form but results in a blank form.  The ,"parent = thisform line" is
> >commented out because it causes a "Property PARENT is read-only" error..
> >
> >FOR i = 1 TO 4
> >FOR j = 1 TO 10
> >oTextbox = CreateOBJECT("TextBox")
> >WITH oTextbox
> >.Name = "TextBox" + LTRIM(STR(i)) + LTRIM(STR(j))
> >.Left = (j - 1) * 10
> >.Top = (i - 1) * 20
> >.Width = 100
> >.Height = 20
> >.Value = "Data for cell " + LTRIM(STR(i)) + ", " +
> LTRIM(STR(j))
> >.Visible = .t.
> >   * .Parent = thisform
> >ENDWITH
> >ENDFOR
> >ENDFOR
> >
> >What am I missing?
> >Thanks in advance,
> >
> >Joe
> >
> >
> >--- StripMime Report -- processed MIME parts ---
> >multipart/alternative
> >  text/plain (text body -- kept)
> >  text/html
> >---
> >
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/caawxvundn+p7etp5jrkoqtne+-xipcrv2g57po6xrabv+dd...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Re: Programatically placing text boxes on a form

2023-10-30 Thread Tracy Pearson
The textbox needs to be added with a method on the form.

thisform.addobject( "TextBox" + LTRIM(STR(i)) + LTRIM(STR(j)), "textbox")

oTextbox = evaluate( "TextBox" + LTRIM(STR(i)) + LTRIM(STR(j)))


HTH,
Tracy


On October 29, 2023 11:43:13 PM EDT, Joe Yoder  wrote:
>I know I had code years ago that did this but it apparently got mangled
>during computer transitions.  The code below runs in the load event of  a
>form but results in a blank form.  The ,"parent = thisform line" is
>commented out because it causes a "Property PARENT is read-only" error..
>
>FOR i = 1 TO 4
>FOR j = 1 TO 10
>oTextbox = CreateOBJECT("TextBox")
>WITH oTextbox
>.Name = "TextBox" + LTRIM(STR(i)) + LTRIM(STR(j))
>.Left = (j - 1) * 10
>.Top = (i - 1) * 20
>.Width = 100
>.Height = 20
>.Value = "Data for cell " + LTRIM(STR(i)) + ", " + LTRIM(STR(j))
>.Visible = .t.
>   * .Parent = thisform
>ENDWITH
>ENDFOR
>ENDFOR
>
>What am I missing?
>Thanks in advance,
>
>Joe
>
>
>--- StripMime Report -- processed MIME parts ---
>multipart/alternative
>  text/plain (text body -- kept)
>  text/html
>---
>
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/44bd27a7-797d-4d3e-8d81-cf2acab82...@powerchurch.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Programatically placing text boxes on a form

2023-10-29 Thread Joe Yoder
I know I had code years ago that did this but it apparently got mangled
during computer transitions.  The code below runs in the load event of  a
form but results in a blank form.  The ,"parent = thisform line" is
commented out because it causes a "Property PARENT is read-only" error..

FOR i = 1 TO 4
FOR j = 1 TO 10
oTextbox = CreateOBJECT("TextBox")
WITH oTextbox
.Name = "TextBox" + LTRIM(STR(i)) + LTRIM(STR(j))
.Left = (j - 1) * 10
.Top = (i - 1) * 20
.Width = 100
.Height = 20
.Value = "Data for cell " + LTRIM(STR(i)) + ", " + LTRIM(STR(j))
.Visible = .t.
   * .Parent = thisform
ENDWITH
ENDFOR
ENDFOR

What am I missing?
Thanks in advance,

Joe


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/cabqednw1rrzyn7show1lppcqpnahn6nchova3vvosmt0nfr...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.