Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3236354
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:36:44+00:00 2026-05-17T17:36:44+00:00

I have a WPF application with form that has a textbox named txtStatusWindow. I

  • 0

I have a WPF application with form that has a textbox named “txtStatusWindow”. I also have a vb.net class handed to me by a co-worker that needs to be called and executed by the code in my application code-behind. My co-worker insists that I will need to use common .net events to update the textbox on my form.

The separate vb.net class:

Public Class globalclass

Public Event txtStatusWindow(ByVal Text As String)


Public Sub InitializeProgram()
    RaiseEvent txtStatusWindow("Updating something.")
    System.Threading.Thread.Sleep(2000)
    RaiseEvent txtStatusWindow("Updating something else.")
    System.Threading.Thread.Sleep(2000)
    RaiseEvent txtStatusWindow("Updating something other than else.")
    System.Threading.Thread.Sleep(2000)
    RaiseEvent txtStatusWindow("Updating something other than the else stuff.")
    System.Threading.Thread.Sleep(2000)
End Sub

End Class

I need to be able to call the sub “InitializeProgram()” from my code-behind, and it needs to be able to update “txtStatusWindow.text” as it runs.

I told him that the updating of the text box can be done with data-binding, but I don’t know how to integrate a separate class like this into my project, how to call methods in it, or how to cause it to update my text blocks through data binding.

I also suggested that the methods in this class aren’t optimal for connecting to the WPF project anyway, but he just wrote it as an example to discover how to connect the two projects.

Eventually, I will need to integrate classes like these that will be running separate threads to update their data from a dynamic source, and cause many controls to update in my application.

So far, the only way we have been able to get this to work from my code-behind is this:

    Partial Public Class SplashScreen

Dim NewText as String

    Public WithEvents Globals As globalclass = New globalclass
    Public Delegate Sub StringDelegate(ByVal Text As String)
    Public SplashText As String

Public Sub New()
    MyBase.New()
    Me.InitializeComponent()
    Me.Show()
    Globals.InitializeProgram()

End Sub

Public Sub UpdateSplashscreenHandler(ByVal Text As String) Handles Globals.UpdateSplashScreen

    StatusWindowText.Text = Text

End Sub

Notwithstanding the fact that the WPF screen “freezes” until the “globalclass InitializeProgram” method completes (txtStatusWindow.Text does not update while sub without using the esoteric “refresh” extension…), I fully believe we are going about this the wrong way.

There are precious few examples out there concerning the integration and then binding to objects in existing code. Thanks for examining our little quandary.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:36:45+00:00Added an answer on May 17, 2026 at 5:36 pm

    If this status window is in XAML and the status window is a UserControl, then add a StatusText dependency property to the status window. Then, in the XAML you can bind to the value of that property with something like:

    <UserControl x:Name="MyStatusWindow" ...>
      <TextBlock Text="{Binding Path=StatusText, ElementName=MyStatusWindow}" />
    </UserControl>
    

    Then, from your event, just update the value of that StatusText property.

    (Is that even close to what you were asking?)

    Also, about that freezing: Instead of doing that updating in the constructor of that class, you might want to do it from the Loaded event of that control. It will still be freezing, though, unless you move it to a separate thread. Right now, that’s happening on the same thread that the UI message pump is running on. This is the Dispatcher for that UI.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF application that has a variable x which is an instance
I have a WPF application that runs fine under XP as an administrator. When
I have written a WPF application that I want to port to Silverlight 2.
I have a simple message box in a WPF application that is launched as
I have a WPF application which so far has been client only, but now
is there a best way to manage a form in WPF application which has
I have a WinForms Form that used to be a standalone application, but is
I have a WPF application that I need to have users access directories in.
I have a WPF application in VS 2008 with some web service references. For
I have a WPF application using Aero Glass. When using the application under a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.