WinForm button click methods are being renewed. with button onclick_1 - winforms

I just finished completing my winforms app. Suddenly when I was changing background color of gridview. When I started my app for final tests the buttons were not working. I checked their on click code and it was correct. Then I double clicked the button it created new button onClick_1 method. SO now all the buttons are doing it :( I dont' know what to do. Please help

Looks like your events are no longer coupled to your code.
Do this for each of your buttons:
Open your designer
Click on your button
Open your properties tab
In this menu, click on the events button
You'll find your "Click" event.
Click on the arrow and select the correct event.

Related

WPF: (SplitButton) MouseLeave won't fire without a click

I working on a WPF Ribbon application using a third party source (Syncfusion).
In my application I have a SplitButton with several CheckBoxes in it, I'm trying to implement MouseHover like action to my SplitButton so that on MouseEnter the DropDown will open and on MouseLeave the DropDown will close.
MouseEnter works great.
MouseLeave works great on a regular button (for changing the background for example) but on SplitButton it won't fire unless I press on the mouse (left or right button - it doesn't matter).
Any chance I could close the DropDown upon leaving the SplitButton without clicking on the mouse? Maybe by using another event?
Any help would be appreciated.

Extjs attaching keyevent to a button-trying to catch tab event on button

I have a form wih many fields in it and a close button at the end. Only in IE, when I tab out of the button, instead of going to the first field in the form, it tabs to the browser url and then to the tabs open in browser and home icon and all browser icons on the top. So, what I want to do is to catch the tab event on close button and bring the focus back to the first field in the form. So, I tried using specialkey, keyup and keydown in the listeners for the button. But, none of them were called when tab event was fired on button. I have enablekeyevents:true in the configuration. Can someone suggest me a way of capturing the tabout event on button. Thank you so much.
I solved it by using blur event on button. I check on blur whether Ext.EventObject.Tab and Ext.EventObject.shiftKey exists

Winform controls reset automatically

when I was changing background color of gridview. When I started my app for final tests the buttons were not working. I checked their on click code and it was correct. Then I double clicked the button it created new button onClick_1 method. All controls are now not pointing to the methods existing. They make new methods upon clicking.

Buttons keeping their focus class after losing focus

I have some buttons in a bottom toolbar of a gridpanel that control adding, and removing records from the row-editing grid.
The handlers are pretty simple: "new" button creates an instance of the model, appends to the grid and then opens a row-editor on the new row; "edit" button just opens the selected row's row-editor; "remove" destroys the record from the store and refreshes the grid view.
For some reason these buttons don't lose the focus class that gives them a border when they have the focus. Here is a picture:
In the picture both the "New" button and the "Remove" button have the focus class, when I press the "Edit" button it also keeps the focus classes even after doing a complete row-edit operation and closing the row-editor.
I did find that when I mousedown on one of these permanently "focused" buttons and then mouseup away from it and then click something else the focus class goes away.
I know that I could put a blur handler for all button components in my respective controllers but I would have thought that this functionality was built in so I am asking to see if there is something I missed somewhere in the docs.
The classes that it won't let go of are these:
x-focus x-btn-focus x-btn-default-toolbar-small-focus
This is with ExtJS 4.1.0 in FF10 on Windows 7. But I did notice similar behavior in ExtJS 4.02 and 4.07, just haven't needed to handle it until now.
I found out what it was:
At some point in the handler chain for each of these buttons the button gets disabled. When a button is disabled in ExtJS it prevents the blur event from firing.
It was necessary to disable the buttons so the solution to simply add button.blur() in the handler was the correct way to do go about it.

Disabled button behaving differently in windows Form

I have two button on form as:
Now when hover the portion common to both button the enabled button shows the mouse hover effect as:
I am not sure why this is done in windows form.
I have checked the same thing in WPF sample it works just fine, There it does not show any effect when we are on disabled button.
If we click on the portion which is common for both button the click for Enabled button is fired.
I want to know why controls have this behavior?
Try putting the disabled button in a panel or a group. Controls aren't really meant to overlap like that, so I expect that the event handler just passes the click through to the enabled button.

Resources