Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
How to disable close button merely on one Tabbed MDI child form
posted

I have a 'startup' Mdi child form which I want to alw***ay open. Therefore, users can close all other Tabbed MDI child forms but not the 'startup' form. How can I do this? The application is in vb.net. Thank you in advanced.

Patrick

Parents
No Data
Reply
  • 8421
    Verified Answer
    posted

    Hello,

    Handle the TabbedMDIManager's TabClosing event. Inside here, do a check on a property that is unique to the "startup" form using the event arg's Tab property. If the tab being closed contains your startup form then cancel the event. However, you'll want to make sure that you handle the FormClosing event for the MDI parent form and set e.Cancel to false or else you won't be able to exit out of your application.

    Private Sub UltraTabbedMdiManager1_TabClosing(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinTabbedMdi.CancelableMdiTabEventArgs) Handles UltraTabbedMdiManager1.TabClosing
       If e.Tab.TextResolved = "Start" Then
         e.Cancel = True
       End If
    End Sub

    Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
       e.Cancel = False
    End Sub

Children
No Data