PC Review


Reply
Thread Tools Rate Thread

BUG: Inherited Button

 
 
Mick Doherty
Guest
Posts: n/a
 
      8th Dec 2003
Steps to reproduce:

Inherit from button.
Add button to project's form.
Run project.
Make button Default.
Press and Hold SpaceBar (so button is pressed)
Move Mouse.
Release SpaceBar.

The button now recieves the first MouseDown and MouseUp events even if the
cursor is not over the button.

Has anyone else seen this? I couldn't find it documented.


 
Reply With Quote
 
 
 
 
Mick Doherty
Guest
Posts: n/a
 
      9th Dec 2003
What's more:
Inherit from ButtonBase and the Button will not repaint after a click by
mouse. It stays Pushed until it loses focus.

"Mick Doherty"
<EXCHANGE#(E-Mail Removed).[mdaudi100#ntlworld.com]> wrote in
message news:%(E-Mail Removed)...
> Steps to reproduce:
>
> Inherit from button.
> Add button to project's form.
> Run project.
> Make button Default.
> Press and Hold SpaceBar (so button is pressed)
> Move Mouse.
> Release SpaceBar.
>
> The button now recieves the first MouseDown and MouseUp events even if the
> cursor is not over the button.
>
> Has anyone else seen this? I couldn't find it documented.
>
>



 
Reply With Quote
 
Mick Doherty
Guest
Posts: n/a
 
      9th Dec 2003
For anyone who's interested, both bugs are related.
The actual Bug is the ButtonBase one which Button then Inherits.
Simple Solution is to Override the OnClick and OnDoubleClick events and add:

MyBase.OnClick(e)
MyBase.OnLostFocus(EventArgs.Empty)


"Mick Doherty"
<EXCHANGE#(E-Mail Removed).[mdaudi100#ntlworld.com]> wrote in
message news:(E-Mail Removed)...
> What's more:
> Inherit from ButtonBase and the Button will not repaint after a click by
> mouse. It stays Pushed until it loses focus.
>
> "Mick Doherty"
> <EXCHANGE#(E-Mail Removed).[mdaudi100#ntlworld.com]> wrote

in
> message news:%(E-Mail Removed)...
> > Steps to reproduce:
> >
> > Inherit from button.
> > Add button to project's form.
> > Run project.
> > Make button Default.
> > Press and Hold SpaceBar (so button is pressed)
> > Move Mouse.
> > Release SpaceBar.
> >
> > The button now recieves the first MouseDown and MouseUp events even if

the
> > cursor is not over the button.
> >
> > Has anyone else seen this? I couldn't find it documented.
> >
> >

>
>



 
Reply With Quote
 
Codemonkey
Guest
Posts: n/a
 
      9th Dec 2003
Nice one Mick. Cheers for sharing with the group. I wish more people done
this more often.

If you ever feel like solving the other 101 bugs in dotnet and Visual
Studio, feel free to share them too

"Mick Doherty"
<EXCHANGE#(E-Mail Removed).[mdaudi100#ntlworld.com]> wrote in
message news:(E-Mail Removed)...
> For anyone who's interested, both bugs are related.
> The actual Bug is the ButtonBase one which Button then Inherits.
> Simple Solution is to Override the OnClick and OnDoubleClick events and

add:
>
> MyBase.OnClick(e)
> MyBase.OnLostFocus(EventArgs.Empty)
>
>
> "Mick Doherty"
> <EXCHANGE#(E-Mail Removed).[mdaudi100#ntlworld.com]> wrote

in
> message news:(E-Mail Removed)...
> > What's more:
> > Inherit from ButtonBase and the Button will not repaint after a click by
> > mouse. It stays Pushed until it loses focus.
> >
> > "Mick Doherty"
> > <EXCHANGE#(E-Mail Removed).[mdaudi100#ntlworld.com]> wrote

> in
> > message news:%(E-Mail Removed)...
> > > Steps to reproduce:
> > >
> > > Inherit from button.
> > > Add button to project's form.
> > > Run project.
> > > Make button Default.
> > > Press and Hold SpaceBar (so button is pressed)
> > > Move Mouse.
> > > Release SpaceBar.
> > >
> > > The button now recieves the first MouseDown and MouseUp events even if

> the
> > > cursor is not over the button.
> > >
> > > Has anyone else seen this? I couldn't find it documented.
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Mick Doherty
Guest
Posts: n/a
 
      9th Dec 2003
And I thought no one was listening.

Are there only 101? :-)

I just thought I'd sort out the "No Icon in a FlatStyle.System Button" bug.
I thought it was going to be easy and to a certain extent it was, but I was
banging my head trying to figure out what I had done wrong to cause the
Paint errors I was seeing, and as it turns out it wasn't me, it was the
Tools I was using (does that make me a bad workman?).
I think I've finished it now, at least I can't think of any other things a
user might do to misuse a button.
Time to look over the code and see what improvements I can make.

"Codemonkey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Nice one Mick. Cheers for sharing with the group. I wish more people done
> this more often.
>
> If you ever feel like solving the other 101 bugs in dotnet and Visual
> Studio, feel free to share them too
>
> "Mick Doherty"
> <EXCHANGE#(E-Mail Removed).[mdaudi100#ntlworld.com]> wrote

in
> message news:(E-Mail Removed)...
> > For anyone who's interested, both bugs are related.
> > The actual Bug is the ButtonBase one which Button then Inherits.
> > Simple Solution is to Override the OnClick and OnDoubleClick events and

> add:
> >
> > MyBase.OnClick(e)
> > MyBase.OnLostFocus(EventArgs.Empty)
> >
> >
> > "Mick Doherty"
> > <EXCHANGE#(E-Mail Removed).[mdaudi100#ntlworld.com]> wrote

> in
> > message news:(E-Mail Removed)...
> > > What's more:
> > > Inherit from ButtonBase and the Button will not repaint after a click

by
> > > mouse. It stays Pushed until it loses focus.
> > >
> > > "Mick Doherty"
> > > <EXCHANGE#(E-Mail Removed).[mdaudi100#ntlworld.com]>

wrote
> > in
> > > message news:%(E-Mail Removed)...
> > > > Steps to reproduce:
> > > >
> > > > Inherit from button.
> > > > Add button to project's form.
> > > > Run project.
> > > > Make button Default.
> > > > Press and Hold SpaceBar (so button is pressed)
> > > > Move Mouse.
> > > > Release SpaceBar.
> > > >
> > > > The button now recieves the first MouseDown and MouseUp events even

if
> > the
> > > > cursor is not over the button.
> > > >
> > > > Has anyone else seen this? I couldn't find it documented.
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Button on top of inherited Control not visble Manfred Microsoft VB .NET 0 6th Aug 2009 01:59 PM
displaying inherited button cameljs18@yahoo.com Microsoft C# .NET 4 13th Dec 2007 07:40 PM
Bug: Localization for Button Control in inherited UserControl benjamin.soulier@gmail.com Microsoft Dot NET Framework 0 17th Nov 2006 09:54 AM
Raise button click event from inherited form Cary Linkfield Microsoft Dot NET 3 1st Oct 2004 10:41 PM
BUG: Inherited Button No.2 Argghhh!! }:-( Mick Doherty Microsoft VB .NET 3 11th Dec 2003 02:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:09 AM.