03csharp - Mdi N Menustrip

You might also like

You are on page 1of 14

C#

MDI
VERA A. PANAGUITON
MDI Applications

An MDI (Multiple Document Interface) application is


an application in which we can view and work with
several documents at once.

MDI applications often have a Window menu item


with submenus for switching between windows or
documents.

APDEV I by Vera A. Panaguiton 2


MenuStrip
Provides a menu system
for a form.

APDEV I by Vera A. Panaguiton 3


MDI Parent Form
Add Form. Then change
IsMdiContainer to True.

APDEV I by Vera A. Panaguiton 4


Change WindowState to
maximized if you want
your form in full screen.

APDEV I by Vera A. Panaguiton 5


File Menu Strip

Drag and Drop MenuStrip


from Toolbox.

Add the following MenuStrip


Items.

APDEV I by Vera A. Panaguiton 6


Create two child forms

APDEV I by Vera A. Panaguiton 7


Double click the Help item
in the MenuStrip to create
method for Menu Item
Click.

Define MDI parent


Form then show the
Help_child Form.

Do the same for New


item and Open the
New_Child Form

APDEV I by Vera A. Panaguiton 8


Debug and click Help or File->New

APDEV I by Vera A. Panaguiton 9


Code for Exit

APDEV I by Vera A. Panaguiton 10


ShortCut Keys
Change KeyPreview Property to True

Edit the Text in the MenuStrip for New.


Add the text Ctrl + N.

APDEV I by Vera A. Panaguiton 11


To add method for the shortcut keys.
Click Events tab, the lightning icon.

Double click on the keyDown


to add the code.

For Control key


For N key

APDEV I by Vera A. Panaguiton 12


Debug then Hold CTRL + N to Open the New_child Form

APDEV I by Vera A. Panaguiton 13


- END -

APDEV I by Vera A. Panaguiton 14

You might also like