﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Save data problem</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 20 Sep 2026 20:08:45 GMT</lastBuildDate><ttl>20</ttl><item><title>Save data problem</title><link>http://forum.strataframe.net/FindPost27242.aspx</link><description>Hi,&lt;br&gt;
I have a problems with controls and Save data.&lt;br&gt;
The problem is, for example - I have RichTextEditor and Bind BO and BO field to it.&lt;br&gt;
When I change text and click Save toolbar button - the object revert value, because it still in focus.&lt;br&gt;
If I click mouse to another control or leave control with TAB, then Save works.&lt;br&gt;
&lt;br&gt;
One idea to emulate TAB keypress before Save :) but maybe exist more good way for this :)&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Denis</description><pubDate>Fri, 28 May 2010 07:39:03 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Save data problem</title><link>http://forum.strataframe.net/FindPost27254.aspx</link><description>Hmm... I am glad it works here! :D&lt;/P&gt;&lt;P&gt;Yeah, as you can notice, I set the control Visible to True just before setting Focus to it, and then back to False.&lt;/P&gt;&lt;P&gt;By the way, just to test, I created a new StrataFrame project without any of this, dropped a RichTextbox on a form, made it bound to a BO property, run it, typed text into it and it saved just fine, without ever leaving the control. You might need to have a look if there isn't anything else going on in your code or you could write a small sample that shows this behaviour and post it here so we can have a look.</description><pubDate>Fri, 28 May 2010 07:39:03 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Save data problem</title><link>http://forum.strataframe.net/FindPost27253.aspx</link><description>Hi Ivan,&lt;br&gt;
The idea is ok, but it does not work.&lt;br&gt;
the focus control must be real visible on the form? Maybe problem the control is behind another controls?&lt;br&gt;
Code processed (debugger) , but control revert value during save.&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Denis</description><pubDate>Fri, 28 May 2010 05:13:23 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Save data problem</title><link>http://forum.strataframe.net/FindPost27247.aspx</link><description>Hey Denis.&lt;P&gt;I have created an Invisible textbox in my BaseForm for situations like that. So I also have a BeforeSave that will take care of getting the focus out of the current control:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub YourBaseForm_BeforeSave(ByVal e As _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MicroFour.StrataFrame.Data.BeforeSaveUndoByFormEventArgs) Handles Me.BeforeSave&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Change focus to pre-built control in order to validate control where focus&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- is set in any form, before saving. This is needed if user saves the form &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- without leaving control. If Validate has code, it will be executed first, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- refreshing any related contents before saving, otherwise save will occur first.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.txtMoveFocusBeforeSave.Visible = True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.txtMoveFocusBeforeSave.Focus()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.txtMoveFocusBeforeSave.Visible = False&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;[/codesnippet]</description><pubDate>Thu, 27 May 2010 10:26:38 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>