Solved

MDI child form display problem

Posted on 2004-08-18
12
528 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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 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