Controls in a panel

  • Thread starter Thread starter reidarT
  • Start date Start date
R

reidarT

I have a Panel. I want to place controls like label and textfields in the
panel. Is it possible to have a "gridlayout" to place the controls where I
want them to be.
regards
reidarT
 
Hi,

I didn't understand your problem quite but here is something.

There is property DrawGrid in property grid which you can use if you are
just putting controls on form.

If you are making your own control and you need more control over DrawGrid
then you can write the designer class for your control and override DrawGrid
and OnPaintAdornments, like this.

private bool disableDrawGrid = false;


protected override bool DrawGrid

{

get

{

if (this.disableDrawGrid)

{

return false;

}

return base.DrawGrid;

}

set

{

base.DrawGrid = value;

}

}

protected override void OnPaintAdornments(PaintEventArgs pe)

{

try

{

this.disableDrawGrid = true;

base.OnPaintAdornments(pe);

}

finally

{

this.disableDrawGrid = false;

}

}

Hope this will help

Vlado
 
Back
Top