473,594 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wait for user response on opened form

I am writing a program that has a portion which downloads files into a
selected directory. It first checks to see if the file exists if the
file exists it opens another form with buttons related to
overwriting, renaming etc. What is the proper way in windows forms
programming to open a new form and wait for the reponse of the form.
Currently I open it with form.show(); form.focus(); In the form I have
a variable set based on the user's input and I would like the program
to halt until there is a response. Related to this I would like the
new form to have focus and maintain focus. i.e. I don't want the
user to be able to navigate back to the mainform and have access to
that functionality. Your help is greatly appreciated.

Nov 16 '05 #1
3 17069
HooHa wrote:
I am writing a program that has a portion which downloads files into a
selected directory. It first checks to see if the file exists if the
file exists it opens another form with buttons related to
overwriting, renaming etc. What is the proper way in windows forms
programming to open a new form and wait for the reponse of the form.
Currently I open it with form.show(); form.focus(); In the form I have
a variable set based on the user's input and I would like the program
to halt until there is a response. Related to this I would like the
new form to have focus and maintain focus. i.e. I don't want the
user to be able to navigate back to the mainform and have access to
that functionality. Your help is greatly appreciated.


Try form.ShowDialog ();
--
to reply, remove .s.p.a.m. from email
Nov 16 '05 #2
Open the second form as a modal dialog. When calling the form from within
your first form:

form2.ShowDialo g(this); // this - your first form - is the owner of
the modal dialog

Form 2 will behave lilke a modal dialog now (such as the OpenFileDialog and
similar classes) and any code after the ShowDialog() method is not executed
until the modal dialog is closed.

Hope that helps.

--
Kai Brinkmann [MSFT]

Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"HooHa" <js*****@cox-dot-net.no-spam.invalid> wrote in message
news:41******** @Usenet.com...
I am writing a program that has a portion which downloads files into a
selected directory. It first checks to see if the file exists if the
file exists it opens another form with buttons related to
overwriting, renaming etc. What is the proper way in windows forms
programming to open a new form and wait for the reponse of the form.
Currently I open it with form.show(); form.focus(); In the form I have
a variable set based on the user's input and I would like the program
to halt until there is a response. Related to this I would like the
new form to have focus and maintain focus. i.e. I don't want the
user to be able to navigate back to the mainform and have access to
that functionality. Your help is greatly appreciated.

Nov 16 '05 #3
Thank you both for your answers! That is exactly what I needed.

Cheers

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1983
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from the DB I am using a DIV with a please wait message which is removed once the page is loaded. In addition I am using a global error handling using the Application_Error void in the Global.asax file. when the application is loading a page which...
1
1817
by: batham | last post by:
Gurus, I have a mainpage.aspx webform, in the page load of this page I am displaying a text "Please wait connecting..." and then I want the user to see this output on the WebForm, while I do some backend processing. Once the backend processing is done I want to redirect the user to another page e.g. "http://www.google.com". I want to achieve the above without javascript, it should be pure ASP.Net, is this possible ?
4
2581
by: dave | last post by:
Hi guys I display one page in popup window...that fetches some data from sql and perfom some calculation (tht approx 10 secs) and display result.... I am trying to display "Please wait ..."message while its performing calculation... I'm using the below code...that i have got from following link http://aspfaq.com/show.asp?id=2498 but somehow it doesnt work and displays nothing....it display only for a second before the actual result is...
7
9755
by: CJM | last post by:
I have a page on our intranet that is supposed to stream an Excel sheet to the user. I'm using pretty standard code: sFilePath = sFileDir & sFilename Response.AddHeader "content-disposition","attachment; filename=" & sFilePath ' Create your header information Response.ContentType = "application/x-msexcel"
4
3498
by: puja patel | last post by:
hi all, I am developing a shopping cart website in C# where after selecting item, user enters credit card details and click on submit button.This request is then processed by the gateway which usually takes from 5-10 sec of waiting period to get response back if the transaction was approved of declined. I want to implement page which says "Please wait...your request is being processed." after user clicks on submit button and before I...
0
1123
by: Gentian Hila | last post by:
I have a crystal report that is being displayed on the web (asp.net – VS studio 2003). I use a wait page, a very simple one, to tell the user to wait until the report is displayed, simply text, no graphics or animation at all. I use the location.replace in the wait page just as you recommend in a msdn article. It works fine as long as it redirects to an asp.net page. But I use the following function to display a pdf file and then...
3
14958
by: tylo | last post by:
Hello, I am using "Sub Main" to open many forms, one at a time. The problem is, there's no default built-in way of keeping Sub Main from going onto the next line of code while the user is supposed to be interacting with a form I just opened. Anyone know what I can use here to somehow have Sub Main wait until the user is done with the form? I was thinking of some sort of signal sent by my forms, as each for will have a button the user must...
8
8285
by: jimatqsi | last post by:
I have a form that opens another form. I want the first form to wait for the form it opened to be filled out before it proceeds with processing what comes after the opening of the other form. In this instance, a form used by the warehouse/shipping system is opening a form to get credit card information. After the credit card info is entered (it may be approved or not approved) I want to close the credit card form and update the order's...
0
7936
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8227
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6646
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5738
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3853
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1469
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.