Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27371

VS 2010 MessageBox.show does not get focus

$
0
0
Hi,
I will explain my situation, sorry for my english.

I got a MDIPARENT form with some childForm.

When i press close in the MDIPAREND, i will close all the childform.

Code:

Private Sub frmMain_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

        For Each ChildForm As Form In Me.MdiChildren
            ChildForm.Close()
        Next
        End Sub

When i close my ChildForm, i will check if this form was save before closing, like this.

Code:

  Private Sub fermer_FrmRegulier(sender As System.Object, e As System.EventArgs) Handles Me.FormClosing
        If MessageBox.Show(Me, "Voulez-vous enregistrer les modifications apportées à la fiche de " _
                                      & txt_Nom.Text & " ? (Q03)", "WinRAS " & CStr(Taux.anneeImposition), _
                                      MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then

            enregistrerFormulaire()

        End If
    End Sub

I got a ploblem whit the focus on my messageBox.show. if the form i modifie is not the last one in PARENTFORM.MdiChildren, the messageBox dont show on the top of all form.

Can someone help me or explain me why that append ?

Viewing all articles
Browse latest Browse all 27371

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>