# .NET and More > WPF, WCF, WF >  Passing data from a textbox on wpf control (element host) to a Winform form

## VintageCoro

Hey Everyone

I have a VB.net project (.Net framework 4.0), with a number of forms. One of the the forms is called (AddModel.vb) where a user of this application can add a model file (e.g. MD5, OBJ, 3DS). On this form there is a Element host that is used to display a WPF Control called (SpellCheckTextbox.xaml). The WPF Control only contains a rich textbox with the ability to spell check the contents of itself. I want to be able to pass the contents of the WPF Rich textbox to a String in either the AddModel.vb form or a module, so that when I click the "Ok" button on my AddModel form, the text is added to a record in my database. However everything I've tried to get the wpf Rich textbox contents and pass it to a public string somewhere else in my application as failed.

Thank you for reading

----------


## VintageCoro

Anyone?????

----------


## VintageCoro

Really starting to dislike WPF

----------


## dee-u

How are you passing the contents of the Richtextbox to a string?

----------


## VintageCoro

That's exactly the problem. My application doesn't even see the control, I can't access the richtextbox from a module, class or Winform. I thought about setting a piece of code inside of the textchanged event that is use for spell checking. 

```
Pseudo  MyModule.Text = richtextbox.contents + richtextbox.contents
```

This doesn't work though

----------


## dee-u

Did it raise any error when you tried using the textchanged event?

----------

