Results 1 to 6 of 6

Thread: Passing data from a textbox on wpf control (element host) to a Winform form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2013
    Posts
    30

    Passing data from a textbox on wpf control (element host) to a Winform form

    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

    Name:  helpme!.png
Views: 3542
Size:  113.4 KB

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Feb 2013
    Posts
    30

    Re: Passing data from a textbox on wpf control (element host) to a Winform form

    Anyone?????

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2013
    Posts
    30

    Re: Passing data from a textbox on wpf control (element host) to a Winform form

    Really starting to dislike WPF

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: Passing data from a textbox on wpf control (element host) to a Winform form

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


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Feb 2013
    Posts
    30

    Re: Passing data from a textbox on wpf control (element host) to a Winform form

    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.
    Code:
    Pseudo  MyModule.Text = richtextbox.contents + richtextbox.contents
    This doesn't work though

  6. #6
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: Passing data from a textbox on wpf control (element host) to a Winform form

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


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width