none
Grid Layout in Panel RRS feed

  • Question

  • Hi,

    How can I create panel with grid layout for putting controls on it like grid?

    Grid Layout - it's that putting controls on screen in view like grid:
    same width in same column,
    same height in same row
    and all controls grow with panel growing.

    Attention: I am writting in C# in the VS2003.

    Where can I get it?

    Thank's
    Alexei
    Sunday, September 4, 2005 10:55 AM

Answers

  • Hi Alexei,

    You might want to check out Beta2 or RC of VS 2005.  There is a new control called TableLayoutPanel that allows you to do exactly what you are describing.  If you don't want to upgrade to 2.0 of the framework just yet, you can find a helpful article for a 1.1 implementation here:

    http://www.csharphelp.com/archives/archive7.html

    Let me know if this helps.

    Scott Morrison
    WindowsForms PM
    Microsoft Corp.
    Tuesday, September 20, 2005 9:11 PM

All replies

  • I realy like to help, but can you clarify a bit wat you want. (for me) this question in not verry clear

    You are talking about rows and columns so you might need something like the datagrid.


    Remco
    Tuesday, September 6, 2005 11:02 AM
  • Hi,

    I mean that controls on the panel will putted in specified row and column with filling the cell. Also the row and column size can be setted.

    Thank's
    alexei
    Tuesday, September 6, 2005 12:22 PM
  • You can do this with the datagrid, but you are rescricted to one columstyle per column.(for all rows the same columstyle eg textboxcolumn)  if you want a column with a diff control per row, you could make a panelcolumnstyle then you can add controls to the panelcolumn. I think this is not an easy job

    Good luck

    Tuesday, September 6, 2005 2:31 PM
  • Hi,

    I know that is not easy. I have put the buttons to the datagrid.

    I want this feature becouse it is easy to create the position of controls inside the panel. This feature I have in Java. I need the same feature to c#.

    Thank's
    Alexei
    Wednesday, September 7, 2005 5:50 AM
  • Hi Alexei,

    You might want to check out Beta2 or RC of VS 2005.  There is a new control called TableLayoutPanel that allows you to do exactly what you are describing.  If you don't want to upgrade to 2.0 of the framework just yet, you can find a helpful article for a 1.1 implementation here:

    http://www.csharphelp.com/archives/archive7.html

    Let me know if this helps.

    Scott Morrison
    WindowsForms PM
    Microsoft Corp.
    Tuesday, September 20, 2005 9:11 PM