[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pnet-developers] [bugs #10394] Control.cs Add(..) does not show the con
From: |
Gopal.V |
Subject: |
[Pnet-developers] [bugs #10394] Control.cs Add(..) does not show the control if the control initially was removed |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040206 Firefox/0.8 |
This mail is an automated notification from the bugs tracker
of the project: DotGNU Portable.NET.
/**************************************************************************/
[bugs #10394] Latest Modifications:
Changes by:
Gopal.V <address@hidden>
'Date:
Tue 10/05/2004 at 16:05 (Asia/Calcutta)
------------------ Additional Follow-up Comments ----------------------------
Seems to work ok, on the CVS build.
/**************************************************************************/
[bugs #10394] Full Item Snapshot:
URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10394>
Project: DotGNU Portable.NET
Submitted by: Heiko Weiss
On: Wed 09/15/2004 at 10:54
Category: None
Severity: 5 - Average
Item Group: None
Resolution: None
Privacy: Public
Assigned to: None
Status: Open
Summary: Control.cs Add(..) does not show the control if the control initially
was removed
Original Submission: - create a form FF
- in this form you have a Control XX
- remove the control XX from the forms FF Controls collection in the
contructure of the form FF
- some time after (e.g. Button Click) add the Control XX to the forms FF
Controls collection by this.Controls.Add( XX )
-> the Control XX is not created correctly and is not been displayed
I have made a quick hack in Control.cs:
...
// Add a control to this collection.
public virtual void Add(Control value)
{
if(value != null)
{
if(value.Parent == owner)
{
// We are already under this owner, so merely
// send it to the back of its sibling stack.
value.SendToBack();
}
else
{
// Suspend layout on the parent while we do this.
owner.SuspendLayout();
try
{
// Change the parent to the new owner.
value.Parent = owner;
// Assign the next tab order if the control doesnt have one.
if (value.tabIndex == -1)
{
int lastIndex = 0;
for (int i = 0; i < owner.numChildren; i++)
{
int index = owner.children[i].TabIndex;
if (lastIndex <= index)
lastIndex = index + 1;
}
value.tabIndex = lastIndex;
}
// Initialize layout within the new context.
value.InitLayout();
}
finally
{
// Resume layout, but don't perform it yet.
owner.ResumeLayout(false);
}
// Now perform layout on the control if necessary.
if ( true /* Heiko Weiss: always create control owner.IsHandleCreated &&
value.Visible */ )
{
// Make sure the control exists.
value.CreateControl();
owner.PerformLayout(value, "Parent");
}
// Notify the owner that the control was added.
owner.OnControlAdded
(new ControlEventArgs(value));
}
}
}
...
Follow-up Comments
------------------
-------------------------------------------------------
Date: Tue 10/05/2004 at 16:05 By: Gopal.V <t3rmin4t0r>
Seems to work ok, on the CVS build.
-------------------------------------------------------
Date: Tue 10/05/2004 at 13:31 By: Heiko Weiss <brubbel>
I added a sample
File Attachments
-------------------
-------------------------------------------------------
Date: Tue 10/05/2004 at 13:31 Name: Control.cs.zip Size: 21.69KB By: brubbel
Sample
http://savannah.gnu.org/bugs/download.php?item_id=10394&item_file_id=1733
For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10394>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/