Browsed by
Schlagwort: wpf

WPF: Text scrollen ähnlich einem Live-Ticker (mit Anhalten)

WPF: Text scrollen ähnlich einem Live-Ticker (mit Anhalten)

Gar nicht so leicht, einen deskriptiven Titel zu finden, der nicht schon wieder komisch klingt. Nun ja.

Ich habe für eine Anwendung mit folgenden Anforderungen eine Lösung gesucht:

  • WPF Anwendung
  • Scrollen ähnlich einem Nachrichtenticker
  • Einzelne Werte werden einzeln eingegeben und scrollen jeweils nur einen Platz weiter, das Scrollen stoppt als zwischendurch

Mehr lesen Mehr lesen

Accessing a WinForm/WPF control from another thread through invoke

Accessing a WinForm/WPF control from another thread through invoke

A pretty common scenario: you have some time-consuming calculation to do (or some other requirements giving the necessity for multithreading), so from your main GUI, you start a worker thread (since then your GUI stays nice and responsive, even though now one of the problems you face is preventing your user from doing things he should not be doing while the thread runs). Since the procedure is so long, you maybe want to update a status label in the main window, or at least you want to set some result string when the thread is finished.

Good idea. But.. if you do it in a straightforward way (calling into your class with a static variable of sorts), your application will throw an exception in debug mode and might (very occasionally) cause trouble in release mode (if there are problems with concurrent access – since WinForms as well as WPF is not created for concurrency).

Fortunately, there is a solution.

Mehr lesen Mehr lesen