Showing posts with label button click. Show all posts
Showing posts with label button click. Show all posts

Friday, January 21, 2011

C# WPF Grid Mouse Event Not Firing

A UIELEMENT in WPF that inherits from Panel, must have a BACKGROUND color in order to bubble a "Click' event.

Tuesday, August 24, 2010

C# WPF Button Blink Problem

In a WPF application, if a button is clicked, the focus gets put on that button.

Sometimes this will cause the button to constantly blink.

In order to stop the button from blinking, some solutions say to put the 'focus' onto another button.

I think, a cleaner way, is to set the 'Focusable' property to false.  This doesn't seem as 'hacky' as setting focus to another button, and still fixes the problem.

Monday, April 19, 2010

Threading the UI in WinForms/WPF

I figured out how to put the UI on a separate thread than the functionality.





This is what you do in the MyForm.cs class. Begin invoke on the Dispatcher.

You must create a DELEGATE -> ClickDelegate and cast the new delegate as that.

Thursday, June 11, 2009

Show Loading gif on button click

I wanted to show a loading gif on a user button click, because the action would take a while. So this is the solution I found.



You make the div style.display = "none;" then on button click, you set the style.display = "";