473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Arrange child form in MDI form

284 100+
Let me try to explain what I want to achieve.

I had one MDI Form and I had putted child form in that. Now I want to arrange child form in MDI form in such a way that it always expend to such extent that it just left few margin at top,right,left and bottom.

It might be similar to center form, but it also include height and widht of the form so even if i medium the size of MDI child form auto resize. Just like you can see in any softwares.

You can also say it like box in a box. Hope you understand what i mean.

I would prefer some function so i can use it many places.
Oct 6 '11 #1
2 2548
muddasirmunir
284 100+
I think the code might work like that

Expand|Select|Wrap|Line Numbers
  1. form1.width=whatever
  2. form1.height=whatever
  3.  
  4. form1.top=(screen.height-form1.height)/2
  5.  
  6. form1.left=(screen.width-form1.width)/2
I am confused, how to control widhth and height
Oct 6 '11 #2
Guido Geurs
767 Expert 512MB
This is the code to set the values for the form and center it.
Just addapt the values to your own needs.
Expand|Select|Wrap|Line Numbers
  1. Private Sub MDIForm_Resize()
  2.    With Me
  3.       If .Width - 1200 > 0 Then
  4.          Form1.Width = .Width - 1200
  5.          Form1.Left = 600 - 90
  6.       Else
  7.          .Width = 4500
  8.       End If
  9.       If .Height - 1200 > 0 Then
  10.          Form1.Height = .Height - 1200
  11.          Form1.Top = 600 - 120
  12.       Else
  13.          .Height = 4500
  14.       End If
  15.    End With
  16. End Sub
Oct 6 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rupang | last post by:
1. How to get a Child Web Form (MODEL Window where user must take an action on that to go back to the Parent window) from a Parent Web Form? 2. How to pass a parameter between Child and Parent...
1
by: | last post by:
Is there anyway to update a control held on my main form from a child form? I've tried making the control itself public but I still can't seem to access it
3
by: fh1996 | last post by:
Form.Owner and Form.Parent, what's the difference between them? Form.ShowDialog() and Form.Show(), when to use which? Form.Activated(), what does it mean when saying a Form is "activated"? ...
2
by: Dmitri Shvetsov | last post by:
Hi, Can somebody give a quick advice? I call a new form from a main form, like: CNewForm nf = new CNewForm(); where I should insert a string into a TextBox.Text field. Then I should...
3
by: PK | last post by:
Hi, I've a MDI form and a child form that comes from a dll. Everything works fine until I had to uncheck or check a menu item in the MDI form based on the changes in the child form. How to acheive...
1
by: Jason Huang | last post by:
Hi, I want to create a Web form in asp.net, using C#. So in a web page, we have one DropDown List or one DataGrid, that when we click an item from a dropdown list, there will pop up another web...
2
by: harvie wang | last post by:
Hi, I want to implement a common Form with special interface, such as MovePoint(double,double). I create a interface first: namespace ABC.Test { public Interface IMyWindowInterface { void...
3
by: juliusy | last post by:
I have Form1 launches Form2. On Form2, user will enter input (a string). When I click OK to close Form2, I need to have that string value populated TextBox1 on Form1 (the parent form). I only...
5
damir
by: damir | last post by:
<div class="box-title"> <h3>Login</h3> <label>Username:</label> <input type="text" name="username" /> <label>Password:</label> ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.