[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: |
Heiko Weiss |
Subject: |
[Pnet-developers] [bugs #10394] Control.cs Add(..) does not show the control if the control initially was removed |
User-agent: |
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) |
This mail is an automated notification from the bugs tracker
of the project: DotGNU Portable.NET.
/**************************************************************************/
[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: Mit 15.09.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));
}
}
}
...
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/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pnet-developers] [bugs #10394] Control.cs Add(..) does not show the control if the control initially was removed,
Heiko Weiss <=