Click here to Skip to main content
11,641,971 members (69,362 online)
Click here to Skip to main content

Implementing UIPAB in MDI

, 11 Nov 2005 21.3K 287 10
Rate this:
Please Sign up or sign in to vote.
This article explains how to use UIPAB pattern when working with MDI in VB.NET
<!-- Article Starts - DO NOT ADD HTML/BODY START TAGS-->

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.

 

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).

 

Solution

 

Yea, it’s very simple.

 I’ve a class called CommonClass (you can have your own name…).

 

Public Class CommonClass

    Public Shared mdi As New MDIFORM

End Class

 

Here MDIFORM is the name of the MDI Form.

Now all you have to do is use this shared object in your Starter class.

 

<STAThread()> _

Public Shared Sub Main()

        AddHandler Application.ThreadException, AddressOf Application_ThreadException

        Application.Run(CommonClass.mdi)

 End Sub

 

One more step, last one…

Put below two lines of code in each of your Child Form Load event, that’s it

 

        Me.MdiParent = CommonClass.mdi

        Me.Dock = DockStyle.Fill

 

Now you know how simple is it, right??

 

Here I put complete UIPAB demo project, in which 5 child forms and 1 MDI form are there.

 

Please feel free to send me your feedback/suggestions.

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

Share

About the Author

RAMANA RAO P.R
Web Developer
United Arab Emirates United Arab Emirates
At present I'm working for Emirates Airlines (Mercator) - Dubai.

You may also be interested in...

Comments and Discussions

 
QuestionWhere's the code??? Pin
mpemberton15-Feb-06 18:12
membermpemberton15-Feb-06 18:12 
AnswerRe: Where's the code??? Pin
bogdan_catrina20-Jun-06 2:42
memberbogdan_catrina20-Jun-06 2:42 
AnswerRe: Where's the code??? Pin
bogdan_catrina20-Jun-06 2:45
memberbogdan_catrina20-Jun-06 2:45 
GeneralUIPAB Pin
Martin Bohring11-Nov-05 2:19
memberMartin Bohring11-Nov-05 2:19 
GeneralRe: UIPAB Pin
Roland Pibinger11-Nov-05 23:09
memberRoland Pibinger11-Nov-05 23:09 
GeneralRe: UIPAB Pin
RAMANA RAO P.R20-Nov-05 18:50
memberRAMANA RAO P.R20-Nov-05 18:50 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150731.1 | Last Updated 11 Nov 2005
Article Copyright 2005 by RAMANA RAO P.R
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid