Board index » delphi » dialog form questions, invisibly repositioning a form, etc.

dialog form questions, invisibly repositioning a form, etc.

Hello
I am using Delphi 6 with the latest update
I have a small dialog box in my app which I center on the screen during the
formActivate procedure, since the user can move it.
i.e. Form1.top = (screen.height - form1.height) div 2, and so on.
If the user moves the form the last time it is opened, there is a flicker as
the form is briefly visible in the old position when reopened before it is
centered.
I handled this by centering the form immediately before calling it. Is there
a better way? I didn't see any handler for handling the form, before it
becomes visible and before formAvtivate executes. There should be one. If I
call from many places, I could use a wrapper function, but was hoping for
something better.

Also, my next and more important question:
I have a bitmap and a small dialog box form opens over it on the screen, and
then after it closes, the program does some process-intensice stuff. But
after the form closes, the form image is still visible on the bitmap. I set
this bitmap to be double buffered.
I places Application.ProcessMessages and Form1.Invalidate right after this
form closes but didn't work. Can anyone tell me how to make the form
completely disappear after it closes?

Thanks,
Gino

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 

Re:dialog form questions, invisibly repositioning a form, etc.


"Gino Costa" <gco...@beld.net> schrieb im Newsbeitrag
news:3c771714$1_4@corp.newsgroups.com...

Quote
> Hello
> I am using Delphi 6 with the latest update
> I have a small dialog box in my app which I center on the screen during
the
> formActivate procedure, since the user can move it.

Couldn't you just set Form1.Position to poOwnerFormCenter?
Ciao, Uli.

Re:dialog form questions, invisibly repositioning a form, etc.


Hello
Thanks, using that idea.
But the real important question I have is why does the image of a custom
form remain when it is over a bitmap, and how do I get rid of that.
Thanks,
Gino

Quote
"Ulrich Gerhardt" <ulrich.gerha...@gmx.de> wrote in message

news:a57oh2$59gtv$1@ID-99119.news.dfncis.de...

Quote
> "Gino Costa" <gco...@beld.net> schrieb im Newsbeitrag
> news:3c771714$1_4@corp.newsgroups.com...
> > Hello
> > I am using Delphi 6 with the latest update
> > I have a small dialog box in my app which I center on the screen during
> the
> > formActivate procedure, since the user can move it.

> Couldn't you just set Form1.Position to poOwnerFormCenter?
> Ciao, Uli.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

Re:dialog form questions, invisibly repositioning a form, etc.


Hello
I think I solved the lingering dialog box image over bitmap problem.
Even though Application.ProcessMessages didn't work before, I placed all the
calling code, including centering the form before calling it, in a wrapper
function and that seems to work better.
But the important thing I wanted to say is that calling Form1.Position :=
poScreenCenter from within the form, like in FormActivate, seems to blank
out the entire application screen for a split second, at least from within
Delphi.
I simply placed this call before calling the form.
I wanted to pass this observation along.

Thanks,

Gino

Quote
"Gino Costa" <gco...@beld.net> wrote in message

news:3c77aa06$1_4@corp.newsgroups.com...

Quote
> Hello
> Thanks, using that idea.
> But the real important question I have is why does the image of a custom
> form remain when it is over a bitmap, and how do I get rid of that.
> Thanks,
> Gino

> "Ulrich Gerhardt" <ulrich.gerha...@gmx.de> wrote in message
> news:a57oh2$59gtv$1@ID-99119.news.dfncis.de...
> > "Gino Costa" <gco...@beld.net> schrieb im Newsbeitrag
> > news:3c771714$1_4@corp.newsgroups.com...
> > > Hello
> > > I am using Delphi 6 with the latest update
> > > I have a small dialog box in my app which I center on the screen
during
> > the
> > > formActivate procedure, since the user can move it.

> > Couldn't you just set Form1.Position to poOwnerFormCenter?
> > Ciao, Uli.

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

Other Threads