Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

 

I have a thread question that has been bugging me for some time.

 

If you are in the middle of an event (button1_click) and you call another form to be initialised. How can you pause the button1 event, work with the new form, when finished with the new form, hide it and carry on with the rest of the button_1 event?

 

What I am trying to do is have a form that collects items from a database. If the item number is not known then a search button can be pressed (button1) and a search form (new form) be displayed where the used can search for the item within the database. When they have found the item that they are looking for they close the search form and button1 uses a �get� method to retrieve the value that you user found in the previous form.

 

Now I can get it to work except that it looks for the get method instantly. I want it to look for the �get� method after the search form has been close.

 

Is there a way of pausing this thread until the search form is closed?

 

This in advance,

Harold Clements

Posted

Just display your new form as a dialog form:

 

Dim frm As New Form2
frm.ShowDialog()

 

Because the form is a dialog form it will pause the thread on the calling form, then when you close the new form the thread will resume. It's the same as calling a message box!

Visit: VBSourceSeek - The VB.NET sourcecode library

 

 

"A mere friend will agree with you, but a real friend will argue."

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...