Introduction
When I started designing my project UI (Win Forms) based on UIPAB pattern, I've come across few issues. One of them is implementing UIPAB in MDI. In fact I searched (u can guess it) for it, many people asking the same question but unfortunately no replies for them (to me too), so I solved it in my own way.<o:p>
<o:p>
Before going to solution I want to thank all programmers who wrote UIPAB articles and helped me a lot in understanding this (of course our PC is also one of them).<o:p>
<o:p>
Solution
Yea, it’s very simple.<o:p>
I’ve a class called CommonClass (you can have your own name…).<o:p>
<o:p>
Public Class CommonClass<o:p>
Public Shared mdi As New MDIFORM<o:p>
End Class<o:p>
<o:p>
Here MDIFORM is the name of the MDI Form.<o:p>
Now all you have to do is use this shared object in your Starter class.<o:p>
<o:p>
<STAThread()> _<o:p>
Public Shared Sub <st1:place w:st="on">Main()<o:p>
AddHandler Application.ThreadException, AddressOf Application_ThreadException<o:p>
Application.Run(CommonClass.mdi)<o:p>
End Sub<o:p>
<o:p>
One more step, last one…<o:p>
Put below two lines of code in each of your Child Form Load event, that’s it <o:p>
<o:p>
Me.MdiParent = CommonClass.mdi<o:p>
Me.Dock = DockStyle.Fill<o:p>
<o:p>
Now you know how simple is it, right??<o:p>
<o:p>
Here I put complete UIPAB demo project, in which 5 child forms and 1 MDI form are there.<o:p>
<o:p>
Please feel free to send me your feedback/suggestions.<o:p>
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.