Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8935483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:59:31+00:00 2026-06-15T09:59:31+00:00

I have a very basic doubt in vb.net threading. I am having a function

  • 0

I have a very basic doubt in vb.net threading.
I am having a function MyFunc1() which actually launches a form and asks for input from the user and returns a string. The return must be done only when user clicks a button called ‘return’ in the Form.

So I framed the function like this.

Public done as Boolean = true
Public str as String

Function MyFunc1() As String
  Start Thread1  //launch UI as seperate thread
  While done
  End While    //Infinite loop to hold the parent loop till done is made as false
  return str
End Function

Function Thread1
  //code to launch UI
End Function

Function onClickReturn  //Function triggered when 'return' is pressed
  str = EditText.text
  done = false
End Function

The problem right now is Thread1 launches the UI but once the UI is launched Thread1 dies and so does the UI Panel.

Any ways to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:59:32+00:00Added an answer on June 15, 2026 at 9:59 am

    I think what you are trying to do doesn’t event need threads. Since your blocking the original thread anyways, there is really no need to create a second thread. Typically you just call

    MyForm.ShowDialog()
    

    That shows a modal dialog and will block the calling code at that line, allowing the UI to be displayed and used until the user dismisses it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to zend framework and having very basic doubt.I have created one
I have a very basic email submission form in my ASP.NET MVC 3 app.
I have a very basic doubt regarding the method that gets executed when app
Well, I think I have a very basic doubt here: I'm developing an app
I have a very basic mysql table called memberships, that tracks which people belong
I have a very basic API in my app which also has an index
I have a very basic doubt. From the code below , I have declared
I have a very basic doubt regarding cloud computing that is catching up pretty
I'm developing a site with CakePHP but I have a very basic doubt: When
I have very basic class: class Customer { protected $id; protected $customer; public function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.