tecknoize Posted November 29, 2003 Posted November 29, 2003 hi guys, I have a form that is a MdiContainer (MDI Parent) and another form that is my "New document" form. frmMain -> MDIParent frmAddContact -> MDIChild So, when I click File>new, one instance of the form frmAddContact open within the form frmMain. Everything's allright here. But I just don't know how to manage if a document as been saved or not. :confused: . It would be cool if an * was shown when the document is not save. Anyone have a clue? :-\ Quote
*Experts* Volte Posted November 29, 2003 *Experts* Posted November 29, 2003 You need to keep a variable on your form called 'IsChanged' or something similar. When you type anything into the document (or modify it in any way), set 'IsChanged' to true. When you save, set it to false. Quote
tate Posted November 29, 2003 Posted November 29, 2003 Use the TextChanged event to set the variable. Example; Private Sub rtbViewer_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) 'Set flag when a change has been detected mblnChanged = True lblStatus.Text = mstrFileName & "**" 'Status to indicate change End Sub Quote
tecknoize Posted November 29, 2003 Author Posted November 29, 2003 ok it worked, but only when I have one MDIChild open. Else, Every MDIChild open gets the same status as every other. Any Idea? :confused: :confused: :confused: Quote
*Experts* mutant Posted November 29, 2003 *Experts* Posted November 29, 2003 Keep one variable for every form. Quote
tecknoize Posted November 29, 2003 Author Posted November 29, 2003 How? Sorry for my ignorance :p Quote
Engine252 Posted November 29, 2003 Posted November 29, 2003 you should add this variable to you mdichild that way every child has a changed var so in you child mdi create a var and change it if the text on that mdi child has changed and if the file has been saved witch should be done by a function again on your mdichild change the change var again that way it can be perfectly managed succes. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.