Solved

MDI child form display problem

Posted on 2004-08-18
12
498 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
12 Comments
 
LVL 10

Expert Comment

by:EBatista
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 10

Expert Comment

by:EBatista
Comment Utility
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
Comment Utility

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 10

Expert Comment

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

Author Comment

by:prakash_prk
Comment Utility

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
Comment Utility
do you want your mdi form without titlebar?
0
 
LVL 10

Expert Comment

by:123654789987
Comment Utility
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
Comment Utility

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
Comment Utility
prakash, sorry but if you want that, you will have to live with the system menu/controls :(
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now