Close form and ask for save


Author
Message
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
No problem.  All of the automation on the form can be both customized to show a different message or turned off completely.  You just have to fish around until you find the property that does what you want it to.  Sometimes the descriptions of the properties help, too (if you can see the description at the bottom of the property sheet, sometimes it's hidden).
Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
Trent L. Taylor (09/05/2007)
where I can find this?





This is a property on the form. If you created a standard .NET form and are not using the SF Standard form or inheriting from the SF BaseForm, you will not have this property....and you will have some other problems down the road as it relates to "normal" functionality. If you select the form in the designer and go to the property sheet, you should see this property.







Sorry I not thinked that AutoAskSaveChanges = AutoShowSaveChangesMessage, I utilized AutoShowSaveChangesMessage on my tests but I supposed that AutoAskSaveChanges have another purpose or something else w00t woops



again I have to say thanks for your great response and sorry for my mistake Smile



- Fabian



Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
where I can find this?

This is a property on the form.  If you created a standard .NET form and are not using the SF Standard form or inheriting from the SF BaseForm, you will not have this property....and you will have some other problems down the road as it relates to "normal" functionality.  If you select the form in the designer and go to the property sheet, you should see this property.


Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
Greg McGuffey (09/04/2007)
Are you expecting the BO on the menu form to be dirty? Did you manipulate it or the CurrentDataTable? If so, you could just either save it or undo the changes, to save or loose those changes, programmatically. Do this in the FormClosing event (I pretty sure Ermm ).



Or you could just set the AutoAskSaveChanges property on the form to not prompt to save the changes. I'm guessing that it would either just always save or always undo or that you can set what it does if you don't ask to save changes.




You're right, I not see before that I edit the currentDataTable and add a new column next to the fill method on the business object Blush



Question:

I can´t find the AutoAskSaveChanges property on the form, not in designer, not via "me.AutoAskSaveChanges = false", where I can find this?



Thanks for you reply



- Fabian
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Are you expecting the BO on the menu form to be dirty? Did you manipulate it or the CurrentDataTable? If so, you could just either save it or undo the changes, to save or loose those changes, programmatically. Do this in the FormClosing event (I pretty sure Ermm ).



Or you could just set the AutoAskSaveChanges property on the form to not prompt to save the changes. I'm guessing that it would either just always save or always undo or that you can set what it does if you don't ask to save changes.
Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
Note about the last post: I only fill a Business object (but not edit any property of them... only filter it sometimes) and fill a treeview with that data



I set on the form:

Me.myBO1.IncludeInFormSave = False

Me.IncludeInFormSaveType = MicroFour.StrataFrame.Business.IncludeInFormTypeOptions.DeterminedByBusinessObject



if I set

Me.AutoShowSaveChangesMessage = False or me.myBo1.clear() and close the form, this not say if I like to save



me.MenuesBO1.IsDirty = true when I test it after the fill method



What I made wrong? thanks!

Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
Trent L. Taylor (04/17/2007)
The StrataFrame baseform already does this when a BO which is dropped on this form is dirty. By default this functionality already exists. You have to set the forms AutoAskSaveChanges property to False to prevent this type of functionality.




I have a "menu" form (it have a Business object to populate a treeview)

When I close the applicaction, it show the save dialog can I avoid this to happen on that form? thanks!
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You could if you iterate through all of the forms and add a handler that references a single method:

Dim loForm As Form

For Each loForm In MyFormsCollection
    AddHandler loForm.FormClosing, Addressof YourFormClosingMethod
Next

You could then place your code in the "YourFormClosingMethod" to check on whatever you needed.

Chan
Chan
Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

What I am doing is to interate all forms, close them and launch connection dialog. Therefore, i couldn't handle formclosing event.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Handle the FormClosed event.  This want you know for sure that the form has been closed.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search