how to make a program wait until a button is clicked - vb.net

How to make a program wait until a button is clicked by the user.
I want to stop my sequence of codes (statements) until a button is clicked by the user.
how can I go this ?

Whatever it is that you want to happen after the button is clicked, just put that code in the handler for the button-click event. To get to that handler, double click on the button in the designer.

Related

Nuxtlj when user refresh,back,close show popup if click refresh or close fire method

I want to my Nuxtjs application when user click refresh or back or close window to show pop up 'Changes made you may not save' and if click refresh or close to the pop up run a method.
If click cancel i want nothing happens!
My point of view is this function to add an event Listener in mounted method and if user click some of this to run a method only if user Refresh or close tab or close window or back button!
window.addEventListener('beforeunload', this.reset)
I want to know how can i realize that user click refresh or close in the pop up to run a method

I am having trouble while clicking a "Submit An App" button on my application which is present on the Menu bar

I am using the below code for this, this is present inside a frame and this also clicks the button but after button is clicked the control is lost. The possible reason i see is the page lands on same page which extra options after the "Submit An App" button is clicked.
I am using c# to code it. The first line finds the button the second line clicks but go for a timeout. I have seen this behavior fist time not sure how to work it out.
IWebElement field = VelocityDriver.FindElement(By.Id("AppSub"));
SeleniumExtensions.ClickElementAndContinue(field);

RadDesktopAlert Click Event

Working with the RadDesktopAlert WinForms component by Telerik, I am wondering how can I perform an action when the user clicks anywhere on the alert window.
To put it blunt, the buttons suck, and it is much more natural (easier) for a user to just click anywhere in the window. I checked the basics, and there doesn't appear to be an event for "Click", nor does it appear to expose it's Hwnd or Handle.
The events that are available are
Closed
Closing
Disposed
Disposing
Opened
Opening
PropertyChanged
RadPropertyChanged
RadPropertyChanging
The problem with the buttons is the UI looks wacky when trying to right-align, and the "click" event doesn't fire unless you click well inside the button - TWICE. So using the Buttons are not an option. What I am looking for is a place to write code that runs when the user clicks anywhere on the RadDesktopAlert box.
Thanks in advance.
The RadDesktopAlert component, has a Popup property, which holds the actual popup element. You can use its Click event for the purpose:
AddHandler radDesktopAlert1.Popup.Click, AddressOf Popup_Click

How to use Button.KeyPress in vb

what I can do to execute Button.KeyPress event in vb ?
for example
Button.Click , should I press the button , so what about Button.KeyPress
Assuming you're talking about Runtime, in order to get the KeyPress event to fire, the Button needs to be first be selected, then press a (keyboard) button.
The KeyPress is normally used for things like a Textbox, it's not normally used with a Button
If you are looking for a way to force the Button.Click event, you can always call Me.Button1.PerformClick()

Click differences between text box and a button

On a form where I display data, if the user clicks the text box I open a virtual keyboard (form) and allow them to click buttons to enter data. When this virtual keyboard is opened, if the path to open was from clicking a text box, the first click in the new form (virtual keyboard) is ignored. If the virtual keyboard form is opened from clicking a button (from the first form), it works fine. I can't find a difference between triggering the virtual keyboard form from either control.
It seems to me that your issue is one of focus. When you trigger the virtual keyboard form to open because of the textbox click, you are somehow immediately returning focus to the caller, and not to the newly opened form. Therefore, you might need something as simple as:
myForm.Focus()
...at the end of the code that is opening the form.
I say this because the first click is "ignored", as you say. I would guess that it's actually consuming that first click as a focus event, and then you get the clicks you want registered as you want after that.