?
Solved

MDI child form display problem

Posted on 2004-08-18
12
Medium Priority
?
542 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
A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

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

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

752 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