473,834 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1969
Have you tried overriding Form.OnClosing ?

--
Adam Clauss

"Marty" <xm******@hotma il.com> wrote in message
news:9KSwe.1153 82$on1.12298@cl grps13...
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******@hotma il.com> wrote in message
news:9KSwe.1153 82$on1.12298@cl grps13...
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******@hotma il.com> wrote in message
news:2YSwe.1003 71$9A2.72355@ed tnps89...
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
1920
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 adjustments by the user in an XML and saving that XML. We read the XML upon restart and make calls to set the adjustments. This approach becomes difficult as we add more controls and more settings can be made by the user. What other techniques can...
4
3659
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 contain a bigger picture of the thumbnailed selected. The problem is that all these thumbnails (and the big picture) are placed quite far down in the document. (a lot of text is at the top.) What I want is that when a thumbnail is clicked, the...
13
7421
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 created forms for both those tables, and inserted the child table form into the master table form as a subform. It works just as it is supposed to, in that I can create a new master record, and then add detail records.
2
1999
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 recommended approach to this? I'm aware that such data is often stored in an appropriate HKCU\Software subkey and/or Application Data subfolder. What I haven't figured out yet is if there is some convenient ..Net component or mechanism which...
4
4250
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 my particular requirements.
0
1089
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, etc. when you exit. As a matter of fact, you can save all the properties of the form and it's controls (colors, text, checkbox states, etc.). Anyway, is there a way to do this in .net or any components that will do it for you? Thanks, Joe
4
2454
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 buttons on Binding Navigator. Now, what I want, that if the user clicks on the Save Button of Binding Navigator, one field of that table should be saved with Current Date and Time. Do I need to use BuyerBindingSource, BuyerTableAdapter or dsBuyer...
3
2076
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
3027
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 the db. This is my query colected from my form: Insert into Propuesta (idprospecto, Objeto, fecharecibo, fechaentrega, idusuario, idestado, presupuestocop, presupuestousd ) values ('1', 'esta es
0
9800
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10516
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10225
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9340
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6961
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5802
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3987
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3085
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.