Is there a chance to catch when a user clicks on another row?
I tried to do it with single click event and check if the row has changed. But this only fires on hotspots.
There is no way to get click event directly. You can use delayed_change_select event for catch async.
Related
Currently the v-select change event will fires multiple times during user typing keywords.
Is there any event will be only fired if user has select an option or press Enter to select an option.
I don't want the change event be fired during user typing keywords.
V-Select#Events
Unfortunately, it looks like the change event only has a parameter that is the value of selected option. There is not event passed through for you to check what actually raised the change event. However, looking at the link above, there are other events you can use.
There is a keydown event listed here that you might be able to leverage. It takes in a keyboard event, you should be able to check what keyboard event was raise i.e. 'Enter'. There are also other events such as mousedown or mouseup.
If I'm creating a new record, and have logic that fires when the user presses the save button. This creates a problem that the user can create a new record, but not press the 'save' button, but just navigate to a new/previous record. The data will be saved, but the other VBA logic won't be fired.
I wish to prevent this, so which would be the best way? I would like navigation to be allowed on the form, just not when the record is new and dirty (navigation during updates are fine).
I've thought of two ideas, but am not sure how to implement either, nor which would be more logical. How would I do these:
Idea 1: Disable the navigation when a record is new and is dirty
Idea 2: Fire the 'presave' logic when the user navigates away from a dirty new record.
You can add your 'logic' in the Form Event "After update"
Private Sub Form_AfterUpdate()
'do some logic stuff here or call another method
End Sub
When I tried it, Access was able to distinguish correctly if the form is dirty or not before firing this event. But you should try it on your own.
I have a DataGridView that contains 1 column defined as a checkbox. I'm not sure which event to use to check whether the cbo has been checked or unchecked. I've been playing with the CellValueChanged event but notice that when I check a box, nothing happens until I do another action. I need the program to react immediately upon checking a box and not waiting until another action is performed.
Any ideas?
It sounds like CurrentCellDirtyStateChanged event is your ticket.
Check out Triggering a checkbox value changed event in DataGridView
I have a Control say for ex a Submit button if user clicks the button twice or more continuously then user receiving same message / same operation taking place twice or more.
I need to avoid this situation.
thanks for your inputs.
You need to detect the button click event either in the code behind of the view (or ViewModel if using the MVVM pattern) and disable the button. Now I take it that your submit button is firing off some kind of asynchronous operation. Once the asynchronous operation has successfully completed you will probably need to enable the button so that it is available again.
Shankar, if you want to avoid clicking on button, you should disable it. If you can give more details about what exactly you are trying to do, more details can be given.
I have a checkbox in my vb.net desktop application,on check change event iam performing some action.i want that on pageload check change event should not fire and it shows checkbox.checked on gui.
Windows sometimes fires an event during form load, for whatever reason. It's really irritating, as you may have noticed. This is "by design" according to Microsoft.
You can initialize a variable (global or static), such as a boolean called "Loading" for example, to true. Then, in the form Shown event reset it to false. In the beginning of the event handler, check that variable and exit whenever Loading is true.
I bet you are creating the checkbox and after that you are setting it to checked.
You should create it already checked.
would be nice if you post the code how you create that checkbox and set it true.
You could use the Click Event of CheckBox and 100% safe every time the checkBox is changing state