How to dock a control in a form?

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

I am new to C# world. And this might be easy to you gurus.
I have a form wih scroll bars. But I want some controls to
stay at top and left side of the form, even when scrolling
the image. I tried to use two group controls and set one
of them to doc on top, and anchor is set to
left,top,right. And the other group was set to doc on
left, and anchor at top,left, bottom. But when I scroll
the image, both group controls are moving with the
scrolling?
Any better way of implement this?
Thanks.


Michael
 
Put a panel in your form containing all the controls that you want to scroll
around. Any controls at the same level as the panel and outside of it will
remain fixed in relation to the form.

--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com
 
* "Michael said:
I am new to C# world. And this might be easy to you gurus.
I have a form wih scroll bars. But I want some controls to
stay at top and left side of the form, even when scrolling
the image. I tried to use two group controls and set one
of them to doc on top, and anchor is set to
left,top,right. And the other group was set to doc on
left, and anchor at top,left, bottom. But when I scroll
the image, both group controls are moving with the
scrolling?

Instead of scrolling the whole form, place the controls which should be
scrolled inside a scrollable panel, the other controls you can place on
the form, maybe in front of the panel.
 
Back
Top