> > I have a WPF application in VB in VSTS 2008 RTM. I am trying to
> > "blink" (momentarily clear) a field of data if the data is reloaded
[quoted text clipped - 30 lines]
>
> - Show quoted text -
> > Apparently DoEvents can not be used in a WPF application because it is
> > not a Windows Forms.
>
> > OK, so how do I get WPF to visually "blink" some text fields in
> > response to a button push?
> > How do I replace the DoEvents functionality in a WPF application?
You could try :
http://shevaspace.spaces.live.com/blog/cns!FD9A0F1F8DD06954!411.entry
Not familiar yet with WPF but you could perhaps do that by using a WPF
animation ?
--
Patrice
> On Mar 18, 12:16 pm, Tom Shelton
><tom_shel...@YOUKNOWTHEDRILLcomcast.net> wrote:
[quoted text clipped - 36 lines]
> System.Windows.Forms is not listed in the available Namespaces under
> References in Project Properties.
It wouldn't be unless you reference the dll - System.Windows.Forms.dll.
> I do not think that System.Windows.Forms can be referenced in a WPF
> application.
Huh? You just need to referece System.Windows.Forms.dll. You can use
Windows forms controls inside of a WPF app, so you most definately can
reference the dll. You just have to add the reference manually.
Of course, since this is a wpf app, using Application.DoEvents is
probably not the right solution anyway...
You might want to look here for a wpf implementation:
http://shevaspace.spaces.live.com/blog/cns!FD9A0F1F8DD06954!526.entry
The code is C#, but, it should be a fairly simple conversion (the code
is not very complex).
I wonder if you can get your blink effect without using a sleep... Have
you tried looking at the wpf animation support?

Signature
Tom Shelton
Don - 19 Mar 2008 16:54 GMT
On Mar 18, 2:21 pm, Tom Shelton
<tom_shel...@YOUKNOWTHEDRILLcomcast.net> wrote:
> > On Mar 18, 12:16 pm, Tom Shelton
> ><tom_shel...@YOUKNOWTHEDRILLcomcast.net> wrote:
[quoted text clipped - 61 lines]
> --
> Tom Shelton
A modified version of the code that you referenced from shevaspace
worked just fine. I got the DoEvents and Blink functionality that I
was looking for. THANK YOU VERY MUCH !!
I wrote the two following routines in VB:
Imports System.Windows.Threading
Imports System.Threading
Public Sub DoEvents()
Application.Current.Dispatcher.Invoke(DispatcherPriority.Background,
New ThreadStart(AddressOf doNothing))
End Sub
Public Sub doNothing()
End Sub
And then in my application the pseudo code goes:
Public Sub OnLoadButton_Click( )
Clear TextFields
DoEvents( )
Fill TextFields from Database
End Sub
This gives me the "Blink" that I needed that visually shows Blank Text
fields briefly before the Text fields are reloaded so that the User
notices that something happened each time the LoadButton is clicked.
It is frequently helpful to be able to force(allow) a screen update
and a short time delay to occur before any remaining code is executed
for purposes like this.
This will be a helpful technique for many VB WPF developers.
THANKS again for your help.