473,320 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Saving form position.

Hi,

I want to save the form position when the user close it. I tried to
place the coordinate saving code in my destructor, but it is not
triggered when I assign the form to null.

Where should I place my code to save the coord. when the form close?

Thanks
Marty
Nov 17 '05 #1
7 1952
Have you tried overriding Form.OnClosing ?

--
Adam Clauss

"Marty" <xm******@hotmail.com> wrote in message
news:9KSwe.115382$on1.12298@clgrps13...
Hi,

I want to save the form position when the user close it. I tried to place
the coordinate saving code in my destructor, but it is not triggered when
I assign the form to null.

Where should I place my code to save the coord. when the form close?

Thanks
Marty

Nov 17 '05 #2
Hi,
What about using Closing event ?

Where are you saving this info into?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Marty" <xm******@hotmail.com> wrote in message
news:9KSwe.115382$on1.12298@clgrps13...
Hi,

I want to save the form position when the user close it. I tried to place
the coordinate saving code in my destructor, but it is not triggered when
I assign the form to null.

Where should I place my code to save the coord. when the form close?

Thanks
Marty

Nov 17 '05 #3
I want to save in the windows registry, I'll try in the closing event.
Thanks,
Marty

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,
What about using Closing event ?

Where are you saving this info into?

cheers,

Nov 17 '05 #4
I'll try that, thank you!
Marty

Adam Clauss wrote:
Have you tried overriding Form.OnClosing ?

Nov 17 '05 #5
dig in the archives , this was handled before here.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Marty" <xm******@hotmail.com> wrote in message
news:2YSwe.100371$9A2.72355@edtnps89...
I want to save in the windows registry, I'll try in the closing event.
Thanks,
Marty

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,
What about using Closing event ?

Where are you saving this info into?

cheers,

Nov 17 '05 #6
..NET depends on garbage collector to destroy objects. Only when GC
decides to destroy the object that the destructor is called. That's why
you don't see your destructor being called immediately.

For what you need, you can either put the code in the Closed event or
in the Dispose method of the form.

Suriyanto

Nov 17 '05 #7
Thank you Suriyanto,
I finally used the OnClosing() event and it work.
Have a nice day!
Marty

Suriyanto Lee wrote:
.NET depends on garbage collector to destroy objects. Only when GC
decides to destroy the object that the destructor is called. That's why
you don't see your destructor being called immediately.

For what you need, you can either put the code in the Closed event or
in the Dispose method of the form.

Suriyanto

Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mahesh Devjibhai Dhola [MVP] | last post by:
Hi, User can adjust the size of columns of a table or the position of splitter in UI. We want these adjustments to be remembered when we restart the application. Currently, we are saving these...
4
by: ojorus | last post by:
Hi! I just wonder how I can save a page's scroll position with javascript. (i'm not a javascript developer) I have a PHP-page with two columns; the left contains a lot of thumbnails, and the right...
13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
2
by: VS Noob | last post by:
Hello. I'm developing Windows.Forms based applications, and each will need per-user persistent data consisting of user preferences, last form size/position, and the like. Is there a standard or...
4
by: CodeRazor | last post by:
I'm unfamiliar with image manipulation using c#. How can i resize a jpg that currently exists in a file and save it resized as a new file. The examples i've found have been a bit misleading for...
0
by: Joe Thompson | last post by:
Hi, I am new to .net programming but am used to Borland C++ Builder (like Delphi). There are third party components available that you drop on a form and it will save the forms size, position,...
4
by: Luqman | last post by:
I have created a form using Data Sources in VB.Net 2005, and Binding Navigator, even I did not write a single line of code and data is displaying, saving, deleting perfectly with the click of...
3
by: | last post by:
Is there an automatic way to tell a windows to save its size and position, or do I have to save these parameters to the registry when the form quits and then reload them next time?
1
by: =?Utf-8?B?ZWdzZGFy?= | last post by:
Hello, I'm trying to save data from textboxes that are connected to a calendarextender and masketeditextender in my SQL db and it is doing it, the problem is with the date and the money fields in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.