473,799 Members | 3,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mdi form restricted within the parent form space

Is it possible to restrict where an mdi form can go within the parent
form....for example, what if I wanted the parent form to have a panel with a
listbox on the left hand side of the form......would it be possible to
somehow code it so that any mdi forms would not be allowed to be dragged over
the panel. (Or when cascaded, the mdi forms wouldn't overlap the panel?)
Nov 16 '05 #1
2 4008
OTTOMH the MDI area is managed by an MdiClient control in the main form.
Find it and change it's size...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Craig" <Cr***@discussi ons.microsoft.c om> wrote in message
news:44******** *************** ***********@mic rosoft.com...
Is it possible to restrict where an mdi form can go within the parent
form....for example, what if I wanted the parent form to have a panel with
a
listbox on the left hand side of the form......would it be possible to
somehow code it so that any mdi forms would not be allowed to be dragged
over
the panel. (Or when cascaded, the mdi forms wouldn't overlap the panel?)

Nov 16 '05 #2
This seems to work...

public Form1()

{

//

// Required for Windows Form Designer support

//

InitializeCompo nent();

//

// TODO: Add any constructor code after InitializeCompo nent call

//

Control mdic=null;

foreach(Control c in this.Controls)

if(c is MdiClient)

{

mdic=c;

}

this.Controls.R emove(mdic);

TreeView tv=new TreeView();

tv.Location=new Point(0,0);

tv.Size=new Size(100,100);

tv.Dock=DockSty le.Left;

this.Controls.A dd(tv);

this.Controls.A dd(mdic);

mdic.Dock=DockS tyle.Fill;

Form f=new Form();

f.MdiParent=thi s;

f.Show();

f=new Form();

f.MdiParent=thi s;

f.Show();

}
--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Craig" <Cr***@discussi ons.microsoft.c om> wrote in message
news:44******** *************** ***********@mic rosoft.com...
Is it possible to restrict where an mdi form can go within the parent
form....for example, what if I wanted the parent form to have a panel with
a
listbox on the left hand side of the form......would it be possible to
somehow code it so that any mdi forms would not be allowed to be dragged
over
the panel. (Or when cascaded, the mdi forms wouldn't overlap the panel?)

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
2583
by: Sean R. Lynch | last post by:
I've been playing around with Zope's RestrictedPython, and I think I'm on the way to making the modifications necessary to create a capabilities-based restricted execution system. The idea is to strip out any part of RestrictedPython that's not necessary for doing capabilities and do all security using just capabilities. The basic idea behind capabilities is that you don't give any piece of code you don't trust a reference to something...
5
73218
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
0
2337
by: Ben | last post by:
Please excuse if this ends up being a double post at some point. I tried posting using another website which crashed, so I am not sure if it will ever get posted. As such I decided to try again on another site. I am having a small problem that I am hoping someone might be able to help me with. I am creating an MDI based application, where the "Administrative" user will have the ability to click on a Menu Item to display a form that...
4
3348
by: gsb58 | last post by:
Hi! On a form I have a calendar. The form is rezised to 1024x768 (Don't worry - this is a training case) when loaded. Now I want to center the calendar on the form so that its edges are equally far from the upper, right, left and bottom borders of the form. I understand I must use the location property, am I right?
4
5527
by: Daniel R. Rossnagel | last post by:
As I can hide the bar of I title of a window daughter maximized within form MDI Already I have proven with different types from borders, hiding thebuttons to maximize, to diminish and control box, but nothing... If somebody can help me I'm thanked Daniel R. Rossnagel
2
4288
by: Rich | last post by:
Greetings. I have a child form inside an MID parent form. The child form is wider than the MID parent form. The child form contains a number of textboxes which are positioned from left to right on the child form where the textbox on the right is not viewable because it extends beyond the right border of the MDI parent form. What I need to happen is when I tab through the textboxes - when I tab into the textbox on the right side of...
5
1704
by: Byron | last post by:
I need to create an application that uses primarily a single form rather than an SDI that creates a new form for everythting. However, I don't want an MDI style application since the users I'm dealing with would be overwhelmed with it. The approach I tried in the past was to use MDI, but made all the child windows occupy the entire parent area without a frame so it looked like a single window. I also allowed only a single instance of...
6
96243
NeoPa
by: NeoPa | last post by:
Introduction The first thing to understand about Sub-Forms is that, to add a form onto another form takes a special Subform control. This Subform control acts as a container for the form that you want to act as a Sub-Form of the main one. That is to say, if you wanted frmB to act as a Sub-Form of frmA, then you would create a Subform control on frmA (in this example we'll call it sfmB). Subforms have a .Form property which contains a...
4
6060
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase this is all very difficult to explain in words, please bear with me as I endevour to explain what it is I am trying to do. It would be helpful if I could attach a graphics file to this posting that would help explain what it is I'm trying to achieve...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10491
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10268
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10247
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10031
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9079
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7571
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.