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. Image for the cookie policy date

Disable the Save Prompt & a Memory Issue

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

1 Reply

AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon