FormExDesktop and GetControls

Discussion in 'Questions (Windows Mobile)' started by BjornF, May 2, 2008.

  1. BjornF

    BjornF Active Member Licensed User

    Dear All,

    I am trying to use the GetControls to empty a number of textboxes from the form FE_Add with the slightly modified code from the helpfile:

    ctrlnames() = GetControls(FE_Add.ControlRef)
    For i = 0 To ArrayLen(ctrlnames())-1
    If ControlType(ctrlnames(i)) = "TextBox" Then Control(ctrlnames(i)).Text = ""

    It works very well in the non-compiled and non-optimised compiled versions, but I get an error message when I try to compile an optimised file (see attached).

    I suspect it is because FE_Add is a FormEx form (from Andrew's FormExDesktop) and that I haven't understood the helpfile from that dll completely...

    Any ideas on what is wrong, and what I can do about it?

    all the best / Björn

    Attached Files:

  2. agraham

    agraham Expert Licensed User

    Yes. Actually I am bit surprised that it works in the IDE/legacy compiler as although Basic4PPC knows the controls exist I didn't think it knew that they were on a FormEx.

    ctrlnames() = GetControls("") should return all the controls and if you named the FormEx controls with a prefix (or suffix) like FE_txt_something you could check for both the control type and the name prefix.
  3. BjornF

    BjornF Active Member Licensed User

    Dear Andrew,

    thank you for the rapid answer. :)

    Best wishes / Björn
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice