dotgnu-pnet
[Top][All Lists]
Advanced

[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: Klaus Treichel
Subject: [Pnet-developers] [bugs #10394] Control.cs Add(..) does not show the control if the control initially was removed
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040906

This mail is an automated notification from the bugs tracker
 of the project: DotGNU Portable.NET.

/**************************************************************************/
[bugs #10394] Latest Modifications:

Changes by: 
                Klaus Treichel <address@hidden>
'Date: 
                Mon 11/22/2004 at 14:09 (GMT)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
works in current cvs.






/**************************************************************************/
[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:  Fixed
Privacy:  Public
Assigned to:  None
Status:  Closed


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: Mon 11/22/2004 at 14:09       By: Klaus Treichel <ktreichel>
works in current cvs.

-------------------------------------------------------
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&amp;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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]