Home All Groups Group Topic Archive Search About
Author
25 Mar 2005 2:40 AM
L
Hi,

   I am writing an ftp program and I provide a form interface (say
Form1) to display the status to the window. This form1 reads an ini
file, which has all the settings needed to do the ftp (Ex: IP address,
username, etc) and starts doing the ftp displaying corresponding
messages to window. This Form1 has a mainmenu and menu items. One of
the menu items is "SetUp". If I want to change the setting used for the
ftp process I can click this menuitem. When I click this  menu item, it
will open another form (say
Form2) which has text boxes for entry values of IP addresses, username,
etc and two buttons "OK" and "CANCEL". Form2 reads the ini file and
loads the text boxes when it opens up. When I change something in the
textboxes and click "OK", it should save them to the ini file and
close.

The problem is when Form2 opens, the ftp process should stop and wait
untill I click ok on Form2 which is not happening. Form1 is just
continuing doing its ftp job and displaying messages to window while
Form2 is open. How can I make Form1 stop the ftp, untill I click "OK"
on Form2. Also after I click "OK", the Form1 should start the ftp again
from the begining, not from where it left off when the menuitem "SetUp"
click event got triggered. How do I achieve this

By the way I am using delegates to display messages to the UI (Form1).

The explanation is a bit lengthy but I am not able to think of small
sample code to put up here. 

Thanks in Advance,
Lalasa.

Author
25 Mar 2005 1:46 PM
Ignacio Machin ( .NET/ C# MVP )
Hi,

Use Form.ShowDialog() instead of Show
also if you are using a thread to do the transfer you should stop the
thread.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Show quote
"L" <lalasa.***@investors.com> wrote in message
news:1111718454.952372.182490@g14g2000cwa.googlegroups.com...
> Hi,
>
>   I am writing an ftp program and I provide a form interface (say
> Form1) to display the status to the window. This form1 reads an ini
> file, which has all the settings needed to do the ftp (Ex: IP address,
> username, etc) and starts doing the ftp displaying corresponding
> messages to window. This Form1 has a mainmenu and menu items. One of
> the menu items is "SetUp". If I want to change the setting used for the
> ftp process I can click this menuitem. When I click this  menu item, it
> will open another form (say
> Form2) which has text boxes for entry values of IP addresses, username,
> etc and two buttons "OK" and "CANCEL". Form2 reads the ini file and
> loads the text boxes when it opens up. When I change something in the
> textboxes and click "OK", it should save them to the ini file and
> close.
>
> The problem is when Form2 opens, the ftp process should stop and wait
> untill I click ok on Form2 which is not happening. Form1 is just
> continuing doing its ftp job and displaying messages to window while
> Form2 is open. How can I make Form1 stop the ftp, untill I click "OK"
> on Form2. Also after I click "OK", the Form1 should start the ftp again
> from the begining, not from where it left off when the menuitem "SetUp"
> click event got triggered. How do I achieve this
>
> By the way I am using delegates to display messages to the UI (Form1).
>
> The explanation is a bit lengthy but I am not able to think of small
> sample code to put up here.
>
> Thanks in Advance,
> Lalasa.
>

AddThis Social Bookmark Button