Question

I'm having an issue with a Win-forms Track bar extending beyond the background of the user control. I have it anchored to Bottom, Left, Right. I can set the sizes manually to make it stay in-bounds, but lose the re-sizing ability.

I would like to have the track-bar expand with re-sizing of the form. This is the standard track-bar control for win-forms. I have included a picture below. The track-bar in question is right below the birds. Its a little hard to see but the track-bar extends way beyond the scope of the window.

track-bar

Was it helpful?

Solution

Hmm, yeah you wouldn't want it going to the birds.

Use the Anchor and Dock properties of the control to adhere it to the edges of your container form.

You can either set them at design time in the Properties Window, or via code that you place in your form's constructor method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top