473,396 Members | 1,921 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,396 software developers and data experts.

Why the child windows cannot to show? VS2005 bug????

Why the child windows cannot to show? But when I remark the line
"pf.MdiParent = this;", the frmProduct window showed but not a child window.
Is it the VS 2005 bug?

I write the code as:

Caller:
private void AppendProductToolStripMenuItem_Click(object sender,
EventArgs e)
{
frmProduct pf = frmProduct.GetChildInstance();
pf.MdiParent = this;
pf.Show();
pf.BringToFront();
}

frmProduct class:
private static frmProduct m_Productform;
public static frmProduct GetChildInstance()
{
if (m_Productform == null) //if not created yet, Create an
instance
m_Productform = new frmProduct();
return m_Productform; //just created or created earlier.Return
it
}
Dec 6 '05 #1
1 1154
I think that part of it might be the fact that you are re-setting the
MdiParent every time you make the call. If anything, I would send the
parent to the GetChildInstance method, and set the MdiParent once, if you
are creating the form.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"abc my vclass" <my********@myclass.com> wrote in message
news:Ox****************@TK2MSFTNGP11.phx.gbl...
Why the child windows cannot to show? But when I remark the line
"pf.MdiParent = this;", the frmProduct window showed but not a child
window. Is it the VS 2005 bug?

I write the code as:

Caller:
private void AppendProductToolStripMenuItem_Click(object sender,
EventArgs e)
{
frmProduct pf = frmProduct.GetChildInstance();
pf.MdiParent = this;
pf.Show();
pf.BringToFront();
}

frmProduct class:
private static frmProduct m_Productform;
public static frmProduct GetChildInstance()
{
if (m_Productform == null) //if not created yet, Create an
instance
m_Productform = new frmProduct();
return m_Productform; //just created or created earlier.Return
it
}

Dec 6 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Umesh | last post by:
Hi, I have 2 Forms. One is a MDI Child form, and one is a normal form. Both these forms are displayed on different events on the Main MDI Form. I have set SizeGripStyle = Show for both these...
8
by: CJack | last post by:
hy, I have an mdi application, i create a child form and I want to know when a button is pressed while that child form is loaded. I have this code: private void frmTestBaby_KeyUp(object sender,...
3
by: James Spibey | last post by:
Hi, I have an MDI application which has aboout 10 child windows. The way the app needs to work is that only one window should be visible at a time and it should be maximized within the parent...
3
by: Maheshkumar.R | last post by:
Hi groups, How i can command over the MDI CHIlD forms created dynamically at runtime from PARENT. Let say, i have generated 5 mdichild forms, but i want to work with child form1 from MDI...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
0
by: Bruin | last post by:
Hi All, I'm having a problem with MDI child forms when the reference to the MDI Parent is set in a Control library. (Sorry for the long post) I have an control library assembly which holds all...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
3
by: Ricardo Maciel | last post by:
The How to page: http://msdn2.microsoft.com/en-us/library/7aw8zc76(VS.80).aspx walks through the creation of MDI child forms. It includes instructions to set the property MdiList to maintain a...
2
by: =?Utf-8?B?a2VubmV0aG1Abm9zcGFtLm5vc3BhbQ==?= | last post by:
vs2005, c# Trying to understand why one way works but the other doesnt. I have not tried to create a simpler mdi/child/showdialog app for posting purposes (I think even this would not be so small...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.