Gerhard Kreuzer

Gerhard Kreuzer


  • Name: [not set]
  • Favorite Languages: [not set]
  • Website: [not set]
  • Location: [not set]
  • About Me: [not set]

Recent Comments

  • Printing in WPF
    06/02/2010 - 07:03

    Hi,

    to all of you don't knowing to call DoEvents outside of windows forms, eg. in a WPF solution, here is the code:

    Private Sub DoEvents()
    Dim frame As New DispatcherFrame()
    Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, New DispatcherOperationCallback(AddressOf ExitFrame), frame)
    Dispatcher.PushFrame(frame)
    End Sub

    Private Function ExitFrame(ByVal f As Object) As Object
    DirectCast(f, DispatcherFrame).Continue = False
    Return Nothing
    End Function

    Works fine. Just replace the dlg.ShowDialog call with the above DoEvents and silent printing with working data binding becames true!!

    With best regards

    Gerhard