PDA

Click to See Complete Forum and Search --> : [RESOLVED] Buttons unclickable


chris128
Feb 3rd, 2009, 06:56 PM
I've got a weird problem... I have a few buttons on my form and after disabling and re-enabling all of the buttons, two of them cannot be clicked. Here is the form in question:

http://i135.photobucket.com/albums/q160/chriswright128/blue2.jpg

The two buttons in the bottom right corner - Import and Cancel - cannot be clicked after I set their IsEnabled property to false and then back to true again.
The weird thing is that I am doing the exact same thing with the other buttons on that form but all of the others still work fine. I have tried just sticking a new button on the form right next to those two and that new one works fine...
Just to clarify, the buttons do not look any different when they are unclickable - they dont look disabled or anything, but when you mouse over them you do not get the normal mouse over effect that buttons give.
To make it even weirder, if I tab to the buttons and then use space bar to press them they both work fine!

I am baffled!

Any ideas?
Need any more info?

Cheers
Chris

EDIT: OK I just found that even if I dont set the button's IsEnabled properties to false and back to true then this same problem occurs anyway :S The thing that seems to trigger this is clicking the Generate Preview button in my app, which runs a background worker that populates the ListView. It doesnt touch the Import or Cancel buttons though so I am rather puzzled...

chris128
Feb 3rd, 2009, 07:22 PM
Nevermind, sorted it!
There was a label that I was making appear in the bottom left corner while the grid was loading items, and even though the label text was only very short and only covered a small area in the bottom left of the form, WPF had decided that this label should automatically stretch to fill the form (and was therefore covering the buttons on the other side of the form), but as the label's background colour is transparent I couldnt tell that. I just happened to notice that the label was set to dock to both sides of the form instead of just the left, so I took off the right hand side docking and voila, buttons work fine :)