vb.net - Button Click Event Within Another -
I have two button start button and stop button. I click on my button start button and run it. I want to stop the program during the start button. But the work will not end until the program starts. How can I check the stop dwarf during the start up I've heard about threading, but I do not know how I can do it.
The Private Sub Button Button (System Object, ByVal e as System.EventArgs) as ByVal Sender Handle Button 1. Click // // // Always check if the user has stopped pushing, if none is released then if this sub is to go / / my code end sub-private sub-button stop (ByVal sender as the system. Object, ByVal and System. EventArgs) Handles Button 3. Click StopClick = True full reply as retarded response = messagebox. ("Do you really want to get out?", "", The message box button. Yes, the message box icon. Q) If answer = vbYes then m Close () End if ending sub
You put threading in the function button 1 code You can use and use threads.
You can refer to this example
'thread' has been created to handle the background process for start_function. Dim as the system threading. Personal sub-start_function () While correct 'Your code is eg Eg: Dim I like integer i = I + 1 end while End Sub Private All Button 1_click (object as sender, and event as ARG) button 1 handles. Click T = New System threading. Thread (address I.start_function) t.Start () end sub personal sub button 2_Click (as the sender object, and eventArgs) button 2 handle. Click T. Ebert () and sub
Comments
Post a Comment