Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a vb .net windows form with a tabcontol. On TabPage1 I have a RichTextBox. The TEXT property of the RichTextBox is bound to a database field. The user can change the text contents of the RichTextBox by typing in the field, cutting/pasting, etc. I then use an update routine to update the database. All that works like a champ. If I type in the RichTextBox field, then change to TabPage2, and back again to TabPage1, the changed value I typed is still there in the RichTextBox.

However, if I change the value of the RichTextBox by setting the TEXT property thru the code, then change to TabPage2, and back again to TabPage1, the value reverts to the original database value (or the last value typed in the field).

I have to be able to set the TEXT value thru code because there is a spell check function on the field.

Can anyone please give me a clue what I need to do to keep the value from reverting? THANK YOU SO MUCH!!!!!

Posted

Found Solution

 

I found a solution to this...If after setting the .text property, I set focus (RichtextBox1.Focus() ) before changing to another TabPage, the set value is retained. Don't know why, but it worked!!

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...