Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Positioning the child controls
 

Positioning the child controls

<.NET Framework 1.1>

I am trying to develop a table control for Windows these days. It should look like an HTML Table control with rows and cells. For this purpose, I inherited from ContainerControl and added a ParentControlDesigner to it.

I overrided the OnPaint method to draw the table border and all the rows and cells in the table. Now I want that if the user drag and drops any other control on to it. I should be notified that a control has recently been added; so that I can alter its location within one of the cells in my table.

I tried to override the OnDragDrop of ParentControlDesigner, and changed the (x,y) tomy desired location. But it didn't work. Plz help....

Waiting for an early response

sohaibi  Saturday, May 27, 2006 1:15 PM

You need to override the OnLayout event and perform you own custom sizing and positioning of each child control according to your cell arrangement. By default this method will just leave each child control in the location it is placed when added to the container.

Phil Wright
http://www.componentfactory.com
Free user interface library for .NET2

Philip Wright  Saturday, May 27, 2006 2:01 PM

You need to override the OnLayout event and perform you own custom sizing and positioning of each child control according to your cell arrangement. By default this method will just leave each child control in the location it is placed when added to the container.

Phil Wright
http://www.componentfactory.com
Free user interface library for .NET2

Philip Wright  Saturday, May 27, 2006 2:01 PM
Thanx for the quick response. Lemme check it :)
sohaibi  Saturday, May 27, 2006 2:10 PM

You can use google to search for other answers

Custom Search

More Threads

• Event handling in design time mode
• Data Output
• 'System.OutOfMemoryException' in Windows Forms Designer
• How to resize the window form control dynamically
• Manually showing a CollectionEditor via a DesignerVerb event handler
• How to get short keys on windows forms in C#.net 2005?
• Windows XP and Data Grid control
• vertical scrollbar trouble
• ColumnSpan in Custom Designer
• Is it possible to hide third column if two columns are assigned to a ListView control ?