Click here to Skip to main content
15,885,278 members
Articles / Desktop Programming / Windows Forms
Article

Implementing UIPAB in MDI

Rate me:
Please Sign up or sign in to vote.
1.25/5 (4 votes)
11 Nov 20051 min read 26.5K   10   6
This article explains how to use UIPAB pattern when working with MDI in VB.NET

Sample Image - MDIWITHUIPAB.jpg

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>

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionWhere's the code??? Pin
mpemberton15-Feb-06 18:12
mpemberton15-Feb-06 18:12 
AnswerRe: Where's the code??? Pin
bogdan_catrina20-Jun-06 2:42
bogdan_catrina20-Jun-06 2:42 
AnswerRe: Where's the code??? Pin
bogdan_catrina20-Jun-06 2:45
bogdan_catrina20-Jun-06 2:45 
GeneralUIPAB Pin
Martin Bohring11-Nov-05 2:19
Martin Bohring11-Nov-05 2:19 
Well at first you should explain what the UIPAB pattern is about.
What problems are solved using the pattern etc.

Then you should explain your specific solution in implementing the pattern in more detail.

As it is now the article has not mutch to say.

A conclusion is the place where you got tired of thinking.

-- modified at 8:19 Friday 11th November, 2005
GeneralRe: UIPAB Pin
Roland Pibinger11-Nov-05 23:09
Roland Pibinger11-Nov-05 23:09 
GeneralRe: UIPAB Pin
RAMANA RAO P.R20-Nov-05 18:50
RAMANA RAO P.R20-Nov-05 18:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.