From: David Kerber on
In article <hvo5k9$4u8$1(a)news.eternal-september.org>, nospam(a)thanks.com
says...
>
> "David Kerber" <dkerber(a)WarrenRogersAssociates.invalid> wrote in message
> news:MPG.26891ee3977c721698968e(a)news.eternal-september.org...
> > In article <#DE2mEQELHA.3344(a)TK2MSFTNGP04.phx.gbl>, nospam(a)Thanks.com
> > says...
> >>
> >> it doesn't appear to,
> >> how else can i know when a form was moved by user clicking in titlebar
> >> and
> >> dragging to new position?
> >
> > Why would your care where the user moves it to?
> >
> > D
>
> so i can save the location and reopen there on next program run
> mark

I do that in most of my apps, only I do it in form_close, rather than
form_resize.

D
From: Karl E. Peterson on
mp formulated on Sunday :
> it doesn't appear to,

Right.

> how else can i know when a form was moved by user clicking in titlebar and
> dragging to new position?

By watching the WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages.
See http://vb.mvps.org/samples/HookXP if you're unfamiliar with such
techniques.

--
..NET: It's About Trust! http://vfred.mvps.org
Customer Hatred Knows No Bounds at MSFT
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-september.org


From: Karl E. Peterson on
Larry Serflaten wrote :
> "mp" <nospam(a)Thanks.com> wrote
>> it doesn't appear to,
>> how else can i know when a form was moved by user clicking in titlebar and
>> dragging to new position?
>
> Why do _you_ need to know?
> When do you _need_ to know?
>
> Think about those, with an open mind of course, and perhaps you'll
> see clear to another solution....

There are, of course, lots of valid reasons. Ever seen an app/window
that "snaps" to the edge of the screen, or to another window, while
it's being dragged?

(I agree, preserving the form position for next run is both a VERY GOOD
thing to do, and totally unnecessary to persist with every mouse
twitch.)

--
..NET: It's About Trust! http://vfred.mvps.org
Customer Hatred Knows No Bounds at MSFT
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-september.org


From: Bob Butler on

"mp" <nospam(a)thanks.com> wrote in message
news:hvo5pt$5gq$1(a)news.eternal-september.org...
>
> "Larry Serflaten" <serflaten(a)gmail.com> wrote in message
> news:hvnkj2$d1v$1(a)news.eternal-september.org...
>>
>> "mp" <nospam(a)Thanks.com> wrote
>>> it doesn't appear to,
>>> how else can i know when a form was moved by user clicking in titlebar
>>> and
>>> dragging to new position?
>>
>> Why do _you_ need to know?
>> When do you _need_ to know?
>>
>> Think about those, with an open mind of course, and perhaps you'll
>> see clear to another solution....
>>
>> LFS
>>
>>
>
> well, i was trying in Form_Terminate but that was calling Form_Load again
> (on calls to Me.Left etc)
> must be _Unload is the trick? will try

form_unload is a good choice

be careful that you don't save the size if the window is minimized or
maximized; you can call GetWindowPlacement to get the normal window
rectangle regardless of the current state.

From: Karl E. Peterson on
Bob Butler formulated the question :
> "mp" <nospam(a)thanks.com> wrote in message
> news:hvo5pt$5gq$1(a)news.eternal-september.org...
>>
>> "Larry Serflaten" <serflaten(a)gmail.com> wrote in message
>> news:hvnkj2$d1v$1(a)news.eternal-september.org...
>>>
>>> "mp" <nospam(a)Thanks.com> wrote
>>>> it doesn't appear to,
>>>> how else can i know when a form was moved by user clicking in titlebar
>>>> and
>>>> dragging to new position?
>>>
>>> Why do _you_ need to know?
>>> When do you _need_ to know?
>>>
>>> Think about those, with an open mind of course, and perhaps you'll
>>> see clear to another solution....
>>>
>>> LFS
>>>
>>>
>>
>> well, i was trying in Form_Terminate but that was calling Form_Load again
>> (on calls to Me.Left etc)
>> must be _Unload is the trick? will try
>
> form_unload is a good choice
>
> be careful that you don't save the size if the window is minimized or
> maximized; you can call GetWindowPlacement to get the normal window rectangle
> regardless of the current state.

Another thing that *really* irritates me is folks who don't check to
see if the form is off the visible screen(s) when they restore a saved
position! Dumb, dumb dumb, DUMB!

--
..NET: It's About Trust! http://vfred.mvps.org
Customer Hatred Knows No Bounds at MSFT
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-september.org


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5
Prev: Happy Birthday
Next: Print to a specific printer