Solved

MDI child form display problem

Posted on 2004-08-18
12
538 Views
Last Modified: 2008-02-01
Hi  friends

I have a typical problem in mdi child form.

I am having Three forms( One is Mdi parent(MDiParent)  and the other two are  child forms (Child1, Child2) )
------------------------------------------------
MDIParent Loads First
--
 Private Sub MDIParent_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim i As New child2
        i.MdiParent = Me
        i.Show()
    End Sub
-----
 The form child2 having one button control
--------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As New child1
        i.MdiParent = Me.ParentForm
        i.Show
    End Sub
--------------

The form child1 properties.
--------------------------------
FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
ControlBox = false

 Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
        MsgBox("some text")
    End Sub

------------------------
while running..
After loading the MDIParent

when I click the Button1 on child2 , child1 loads. The messagebox displays. At the time look at the child form, Its Icon is Flying window and the control box are all appears

How fix the error...
Thank you .
Prakash
0
Comment
Question by:prakash_prk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 10

Expert Comment

by:EBatista
ID: 11829582
hi prakash, that is not an error, that is a normal behaviour of mdi chils forms. ControlBox property has no effect on them, they have sizable borders, a control-menu box, and minimize and maximize buttons, regardless of the settings of the FormBorderStyle, ControlBox, MinimizeBox, and MaximizeBox.

regards
Elio
0
 
LVL 10

Author Comment

by:prakash_prk
ID: 11829646
Hi Ebatsita

Thank you for your comment.

      But I am having 20 images each of them 100k to display on the form . while loading the images the display above I am  mentioned appears .

 How to avoid this ??

regards
prakash

0
 
LVL 27

Expert Comment

by:planocz
ID: 11829921
Try this....
 
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim objForm As New child1
        objForm.ShowDialog()
    End Sub
0
Stressed Out?

Watch some penguins on the livecam!

 
LVL 10

Expert Comment

by:EBatista
ID: 11830340
just dont set it as mdi child, you can achieve that by using the Owner property instead:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As New child1
        i.Owner= Me
        i.Show
    End Sub


0
 
LVL 10

Author Comment

by:prakash_prk
ID: 11837989

Hi EBatista

Owned Forms !!! .Your method works. The Menu in the child form are not goto the MDIparent .

I want it in MDI Child forms.

regards
Pakash
0
 
LVL 10

Expert Comment

by:EBatista
ID: 11840378
Pakash, what do you actually want to achieve?
0
 
LVL 10

Author Comment

by:prakash_prk
ID: 11840434

My form loads very slow because of the images . At the time for a few seconds (2)  the titlebar for child form & windows logo displayed.

How to prevent this ?

regards
prakash
0
 
LVL 10

Expert Comment

by:EBatista
ID: 11840825
do you want your mdi form without titlebar?
0
 
LVL 10

Expert Comment

by:123654789987
ID: 11840875
What u want to achieve can be done using a Parent Form and 2 Child Forms. Parent Form in your case should not be a MDI form. Create a normal form as the parent. Then call the child form from the parent using

Dim objForm As New child1
  objForm.ShowDialog()
0
 
LVL 10

Author Comment

by:prakash_prk
ID: 11857687

Hi all

I want MDI Form with titlebar
Friends I have 20 forms in my project . There is only one form is mdi parent all other forms are MDI Child. All the child forms having some menu's.

hi 123654789987, your method works but it have little drawback the menu's in child form  doesn't goes to parent ..

regards
prakash
0
 
LVL 10

Accepted Solution

by:
EBatista earned 125 total points
ID: 11866774
prakash, sorry but if you want that, you will have to live with the system menu/controls :(
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question