Re: ShowModal screen position



Ahh I see. I was thinking of something along these lines, but I'm not
sure how to actually display the form modally at a certain position on
the screen (when you have worked out the position)? ShowModal only
returns an integer and doesn't allow you to specify anything.

One way which would work i suppose is setting the left and top
properties OnShow of the second form, so this would be after calling
showmodal rather than before as you specified, correct?

James R.

Andreas Koch wrote:

JamesR wrote:
I'm showing a second form modally through a button on my main form. I
have the position property of the second form set as poMainFormCenter -
but if I have my main form at the edge of the screen, the second form
is shown half hidden (the rest of it is off the screen). I'm thinking
this would be complicated to solve - I.E: to detect whether the form is
shown off the left of the screen or not, and display it accordingly..?

At least in a single screen configuration, you should be able to
figure this out yourself by checking screen.width, screen.height
and form1.width, form1.height before calling the showmodal.

.