Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Show notification after ReceiveFile

Sort Posts: Previous Next
  •  12-28-2007, 8:34 AM Post no. 5287

    Show notification after ReceiveFile

    Hello,

    I am trying to display a form after a complete BeginReceiveMultipleFiles operation.

    This is my code

    FrmInfo oFrmInfo = new FrmInfo();
    oFrmInfo.Show();

    I am trying with a thread :
    System.Threading.Thread oThread = new System.Threading.Thread(new System.Threading.ThreadStart(AfficheNotification),0);
    oThread.Start();

    void AfficheNotification()
    {
    FrmInfo oFrmInfo = new FrmInfo();
    oFrmInfo.Show();
    }

    the problem is the FrmInfo appear but instantly disepear (whit the thread) or the application bug an the FrmInfo is not display (without thread).

    If I add a messagebox.SHow in the onLoad function of FrmInfo, I can see the messagebox but when I click on "Ok" the form diseapear.

    In the form frmInfo, I have a label with a sample text, when I can see the frmInfo, I can't see the label.

    Sorry for my poor english, I hope you can help me

    Regards
  •  12-28-2007, 12:24 PM Post no. 5288 in reply to 5287

    Re: Show notification after ReceiveFile

    I'm not totally sure I understand what you are trying to do.

    Normally, if you want to show the use a notification after receiving files, you do it in the callback you provide to the BeginReceiveMultipleFiles method.

    In that callback, you can show a modal form, which will of course close when the user clicks OK.

    e.g. :
    <code>
    asyncFtpClient.BeginReceiveMultipleFiles(
    filesToRetreive,
    localFolder,
    true,
    true,
    new AsyncCallback( ReceiveMultipleFilesCompleted ),
    null );

    private void ReceiveMultipleFilesCompleted( IAsyncResult asyncResult )
    {
    try
    {
    asyncFtpClient.EndReceiveMultipleFiles( asyncResult );
    MessageBox.Show( "Files received" );
    }
    catch( Exception ex )
    {
    MessageBox.Show( ex.ToString() );
    }
    }
    </code>

    André
    Software Developer and Tech Support
    Xceed Software Inc.
  •  01-09-2008, 8:11 AM Post no. 5289 in reply to 5288

    Re: Show notification after ReceiveFile

    Thanks for your help,

    Your issue is't fine in my situation.

    I solve y problem with create callback function for lots of object call

    eg :

    delegate void ShowNotificationCallBack();
    private void ShowNotification()
    {
    if (InvokeRequired)
    {
    ShowNotificationCallBack oShowNotificationCallBack = new ShowNotificationCallBack(ShowNotification);
    this.Invoke(oShowNotificationCallBack);
    }
    else
    {
    new frmNotification.Show();
    }
    }

    Sorry for my very poor english
    Regards.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.