Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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? :-\

  • *Experts*
Posted
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.
Posted

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

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...