473,763 Members | 10,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BUG: Inherited Button

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.
Nov 20 '05 #1
4 1403
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"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in
message news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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.

Nov 20 '05 #2
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.OnLostFo cus(EventArgs.E mpty)
"Mick Doherty"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in
message news:OI******** ******@TK2MSFTN GP12.phx.gbl...
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"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in message news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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.


Nov 20 '05 #3
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"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in
message news:er******** *****@tk2msftng p13.phx.gbl...
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.OnLostFo cus(EventArgs.E mpty)
"Mick Doherty"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in message news:OI******** ******@TK2MSFTN GP12.phx.gbl...
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"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote

in
message news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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.



Nov 20 '05 #4
And I thought no one was listening.

Are there only 101? :-)

I just thought I'd sort out the "No Icon in a FlatStyle.Syste m 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 " <hu*********@ho tmail.com> wrote in message
news:Ot******** ******@TK2MSFTN GP12.phx.gbl...
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"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in message news:er******** *****@tk2msftng p13.phx.gbl...
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.OnLostFo cus(EventArgs.E mpty)
"Mick Doherty"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote

in
message news:OI******** ******@TK2MSFTN GP12.phx.gbl...
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"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]>
wrote in
message news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> 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.
>
>



Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1290
by: Terrance | last post by:
Hello all I have a question I'm hoping someone can shed some light on. I have 2 user Inherited Controls on a form. When I click 1 inherited control I would like to change the text of the other Inherited Control. Is there anyway to do this? For example, I have an ADD button which is inherited and a EXIT button which is inherited. The reason I made them inherited is because I want to use the function of these buttons in other forms and don't...
3
1090
by: Tamir Khason | last post by:
Please help. I know that there are a lot of developers suffer from this bug in VS.NET. I know to ho reproduce it quickly!!! BUG: Code disappear when moving from code to design time and compiling REPRODUCTION: 1.- Create a windows forms application (I've just tested C#) 2.- Create a new usercontrol and compile 3.- Create an inherited usercontrol from the first one 4.- put a panel into the usercontrol2 5.- put a button into the panel
3
1270
by: Mick Doherty | last post by:
Minimal Code and steps needed to show problem. Inherit from Button and set Region as below. \\\ Protected Overrides Sub OnPaint(ByVal pevent as PaintEventArgs) MyBase.OnPaint(pevent) Me.Region = New Region(New Rectangle(5, 5, Width - 10, Height - 10)) End Sub ///
13
2242
by: Lorne Smith | last post by:
Hi, First, sorry for the crosspost, but it seemed appropriate... :) I've come accross what I consider to be a bug, but I don't know if it's already known or not. (VS .Net 2003 Pro - VB.Net) Whilst playing with inherited forms, I created a simple base form containing a single button. I set this buttons' Click event to be public overridable and put "me.Close" in the code.
9
2054
by: fabio.bizzetti | last post by:
Hello all, I went across what seems possibly a bug of the compiler (VisualC 2005, just for the record) or a very strange and non-expected (by me at least) behaviour of the C++ ISO standard. Thus I'm posting on both newsgroups. Here we go: I noticed that if I nest a structure inside another one, the wrong constructor will be called.. the one from a different class!! Here is some test code:
0
9383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10139
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9933
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9819
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5268
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2790
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.