Can't show forms 
Author Message
 Can't show forms

I am writing a program that uses a sequence of five screens.  If a user
chooses to go back to the previous form I want to hide the form they are
currently working on and show the previous form.  Below is the code I am
using in a cmdButton to show the next form.

IF WEXIST('reg3')
      HIDE WINDOW reg2
      &&ACTIVATE WINDOW reg3
      SHOW WINDOW reg3
ELSE
      HIDE WINDOW reg2
      DO FORM c:\registration\reg3 WITH thisform.parval,m.cGroup
endif

The forms hide correctly but I can't get them to show again.  I've tried
different combinations of activate deactivate and show windows when the next
form already exists.  Why won't my form show that already exists?

Any help will be greatly appreciated!

Thanks,

Kendall R. Dixon
Information Systems
Tusculum College
Phone: 423/636-7300 ext.5750



Wed, 30 Nov 2005 00:08:47 GMT  
 Can't show forms
You used the term form and not screen, so I'll assume you're using VFP and
not FPW or earlier.

In that case, the window commands (SHOW, ACTIVATE, HIDE) are the least
preferred method. They're really meant to go with the old-style DEFINE
WINDOW-style windows. It's far better to call the form object's respective
method.

And while we're talking "preferred" ways, what you describe sounds very
wizard-like. Most people would make the five forms into five tab-less pages
of a pageframe on a single form. All you'd need to do then is activate the
proper page.

Not knowing for sure what environment you're in, or how you've launched your
forms, it's impossible to really give any advice. But if I was guessing, I'd
guess the form objects have different names than what you're assuming.

Dan


Quote:
> I am writing a program that uses a sequence of five screens.  If a user
> chooses to go back to the previous form I want to hide the form they are
> currently working on and show the previous form.  Below is the code I am
> using in a cmdButton to show the next form.

> IF WEXIST('reg3')
>       HIDE WINDOW reg2
>       &&ACTIVATE WINDOW reg3
>       SHOW WINDOW reg3
> ELSE
>       HIDE WINDOW reg2
>       DO FORM c:\registration\reg3 WITH thisform.parval,m.cGroup
> endif

> The forms hide correctly but I can't get them to show again.  I've tried
> different combinations of activate deactivate and show windows when the
next
> form already exists.  Why won't my form show that already exists?

> Any help will be greatly appreciated!

> Thanks,

> Kendall R. Dixon
> Information Systems
> Tusculum College
> Phone: 423/636-7300 ext.5750



Wed, 30 Nov 2005 00:43:10 GMT  
 Can't show forms
I am using VFP7.  I prefer not to use a tabless pageframe because I am
resizing my forms for different conditions.  The five forms are named
regstart,reg2,reg3,reg4,reg5.  When reg3 is active and the user wants to go
back to reg2 the hiding of reg3 and showing of reg2 works correctly.
However while reg2 is correctly active and reg3 exists, reg3 is not showing.
By the way, I am using modal forms.

Why would the show and hide commands work for one form but not another?

Does anything else have to be included with the commands in order for them
to work correctly?


Quote:
> You used the term form and not screen, so I'll assume you're using VFP and
> not FPW or earlier.

> In that case, the window commands (SHOW, ACTIVATE, HIDE) are the least
> preferred method. They're really meant to go with the old-style DEFINE
> WINDOW-style windows. It's far better to call the form object's respective
> method.

> And while we're talking "preferred" ways, what you describe sounds very
> wizard-like. Most people would make the five forms into five tab-less
pages
> of a pageframe on a single form. All you'd need to do then is activate the
> proper page.

> Not knowing for sure what environment you're in, or how you've launched
your
> forms, it's impossible to really give any advice. But if I was guessing,
I'd
> guess the form objects have different names than what you're assuming.

> Dan



> > I am writing a program that uses a sequence of five screens.  If a user
> > chooses to go back to the previous form I want to hide the form they are
> > currently working on and show the previous form.  Below is the code I am
> > using in a cmdButton to show the next form.

> > IF WEXIST('reg3')
> >       HIDE WINDOW reg2
> >       &&ACTIVATE WINDOW reg3
> >       SHOW WINDOW reg3
> > ELSE
> >       HIDE WINDOW reg2
> >       DO FORM c:\registration\reg3 WITH thisform.parval,m.cGroup
> > endif

> > The forms hide correctly but I can't get them to show again.  I've tried
> > different combinations of activate deactivate and show windows when the
> next
> > form already exists.  Why won't my form show that already exists?

> > Any help will be greatly appreciated!

> > Thanks,

> > Kendall R. Dixon
> > Information Systems
> > Tusculum College
> > Phone: 423/636-7300 ext.5750



Wed, 30 Nov 2005 01:10:59 GMT  
 Can't show forms
use form.Hide() & form.Show
or use form.Visible = .t.\.f.

like :

procedure ShowForm(cFormName, cFormName)
    for m.i = 1 to 5
        m.cI = transform(m.i)

         if type("reg" + m.cI + ".Class") = "C"   && form exists
             eval("reg" + m.cI + ".Hide()")
    endfor

    if type(m.cFormName + ".Class") = "C"   && form exists
       eval(m.cFormName + ".Show")
    else
        do form (m.cFormName)
    endif

endproc


Quote:
> I am writing a program that uses a sequence of five screens.  If a user
> chooses to go back to the previous form I want to hide the form they are
> currently working on and show the previous form.  Below is the code I am
> using in a cmdButton to show the next form.

> IF WEXIST('reg3')
>       HIDE WINDOW reg2
>       &&ACTIVATE WINDOW reg3
>       SHOW WINDOW reg3
> ELSE
>       HIDE WINDOW reg2
>       DO FORM c:\registration\reg3 WITH thisform.parval,m.cGroup
> endif

> The forms hide correctly but I can't get them to show again.  I've tried
> different combinations of activate deactivate and show windows when the
next
> form already exists.  Why won't my form show that already exists?

> Any help will be greatly appreciated!

> Thanks,

> Kendall R. Dixon
> Information Systems
> Tusculum College
> Phone: 423/636-7300 ext.5750



Wed, 30 Nov 2005 02:42:48 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Graph doesn't show show data

2. form doesn't show up in debug mode

3. FORM'S SHOW METHOD DOES NOT FIRED

4. EXE doesn't show form

5. start form don't show

6. form doesn't show up in debug mode

7. Don't show record data when loads form

8. vfp - 'internetexplorer.application' -show images

9. vfp - 'internetexplorer.application' - show images

10. White in toolbar BMP's doesn't show up

11. vfp - show images - CreateObject('internetexplorer.application')

12. fvp7's a bug of Editbox couldn't show its SCROLLBAR

 

 
Powered by phpBB® Forum Software