Link to home
Start Free TrialLog in
Avatar of Karen Wilson
Karen WilsonFlag for United States of America

asked on

How do I add a return carriage to a WPF ElementHost in a Windows Form?

I needed to add spell check to a windows form textbox so I used the add a WPF Interoperability, ElementHost option.  I added this code.

Dim CommentHost = New System.Windows.Controls.TextBox()
        CommentHost.SpellCheck.IsEnabled = True
        CommentHost.VerticalScrollBarVisibility = ScrollBarVisibility.Visible
        CommentHost.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible
        CommentHost.TextWrapping = TextWrapping.Wrap

        Me.hostBox.Child = CommentHost

I have everything working very nice - saving to tables, loading edit screens until I hit the return key to add another line...  Doh, nothing happens!  

Any suggestions?  My users add several "one-liners" to their activity report and this is a must-have.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Michael Fowler
Michael Fowler
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Karen Wilson

ASKER

Worked like a charm.  Thanks for the link as well.  Exactly what I need!!  

Have a great evening....