We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Disable the Save Prompt & a Memory Issue

Thread ID:

Created:

Updated:

Platform:

Replies:

563 Jul 7,2002 05:41 AM Jul 13,2002 01:50 PM Windows Forms 1
loading
Tags: EditControl
Administrator [Syncfusion]
Asked On July 7, 2002 05:41 AM

Hi, how to disable the save dialog which shown if you quit with a modified file? Also, the control doesn't seems to be terminated even if I manually garbage collect it. It looks like it is kepted in the memory, becuase, the save dialog shows when the main form terminate, not when the control is set to nothing. Imports Syncfusion.Windows.Forms.Edit Public Class Form1 : Inherits Form Dim e As New EditControl() Dim WithEvents btn As New Button() Public Sub New() e.Dock = DockStyle.Fill btn.Dock = DockStyle.Bottom Me.Controls.Add(e) Me.Controls.Add(btn) End Sub Private Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn.Click Me.Controls.Remove(Me.e) Me.e.Dispose() Me.e = Nothing GC.Collect() btn.Enabled = False End Sub End Class

Administrator [Syncfusion]
Replied On July 13, 2002 01:50 PM

Hi Tony, Sorry for the delay. The Modified property of EditControl can be set to be false to avoid the popup of the save modified dialog box, i.e., editControl1.Modified = false The latest version of Essential Edit has removed the linkage between the edit control object and the application object, i.e., following code is removed from EditControl: Application.ApplicationExit += new EventHandler(OnAppExit); ... private void OnAppExit(object sender, EventArgs evArgs) { ... } The garbage collection should be processed without problem with the above modification. However, it is up to user to hook up the Closing event of the parent form to achieve the save-modified function. Sample code for handling the Closing event of the parent form is listed below: VB code: Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing If (EditControl1.SaveModified()) Then e.Cancel = False Else e.Cancel = True End If End Sub C# code: private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (editControl1.SaveModified()) { e.Cancel = false; } else { e.Cancel = true; } } You will have to download the latest version from our website to get the changes. Syncfusion Technical Support

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;