Recent

Author Topic: Error in screen height of the previous form after close a Form  (Read 5175 times)

nightrider

  • Full Member
  • ***
  • Posts: 139
Error in screen height of the previous form after close a Form
« on: September 21, 2011, 04:17:03 pm »
I'm developing a Windows Moible/arm application to run on handheld data collectors.

I'm using the Show method(instead of ShowModal) to show new screens since it was recommended by one developer involved in the development of WinCE/arm version of Lazarus library.

I show the screens 1, 2 and 3. Then I close the screen 3 calling the Close method.

As you can see in the attachment #4 when the focus return to the screen2 a piece of the top of the screen 2 disappears. It seems to have the exactly height of the windows mobile task bar that is showed in the top of the windows mobile screens.

Before show the screens, I call a method that erases this task bar and it allows me to use this additional space of screen.

If I close the screen #2, the screen #1 is also showed with the top of the screen lost. %)

Greetings from Sao Paulo - Brazil

Ricardo

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Error in screen height of the previous form after close a Form
« Reply #1 on: September 21, 2011, 04:24:44 pm »
If you use Close command on form you shouldn't be able to open it again right? Counterpart to Show command is Hide, which is same as formX.Visible:=false.

nightrider

  • Full Member
  • ***
  • Posts: 139
Re: Error in screen height of the previous form after close a Form
« Reply #2 on: September 21, 2011, 04:46:32 pm »
Wrong! Although I use the construction:

if not Assigned(MyForm) then
   MyForm := TMyForm.Create(Self);
MyForm.Show;

Everytime I want to open a screen. For safety, if you know what I mean...

I substitute the Self.Close in the Form o Screen3(see attachments) by Self.Hide and nothing happens. The screen2 remains appearing with the top of it lost.

Cheers ;D

nightrider

  • Full Member
  • ***
  • Posts: 139
Re: Error in screen height of the previous form after close a Form
« Reply #3 on: September 22, 2011, 02:38:10 pm »
Problem solved.

I move the method call from OnActivate to OnShow and the first method is done only at open of application.

Cheers

Ricardo

 

TinyPortal © 2005-2018