Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I make a TrackBar in User control with two Thumbs . But if I drag in horizontal this component in form.Design , mess all , the thumbs go to rigth , the trackbar go to down, i need a command that keep this trackbar static.

What I have tried:

I tried put in properties the value false or true in the 'AutoSize', but nothing change
Posted
Updated 23-Mar-16 7:09am
Comments
BillWoodruff 24-Mar-16 1:13am    
Is this WPF ? or WinForms ? or ASP.NET ? WinForms has no native control named 'Thumbs or 'ThumbNail.

1 solution

First off, don't use the word "static" to do with anything C# related - it has a very specific meaning which is nothing to do with your problem! :laugh:
The problem is probably to do with the size of the user control, and how you have the Anchor and Dock properties set for the controls that make it up.
Assuming the thumbs should be to the left and right of a central trackbar, then none of them should have Dock set to anything, and the Anchor properties should be set as shown below:
thumbLeft     trackBar       thumbRight
Top+Left   Top+Left+Right    Top+Right

That way, the buttons will remain fixed size, but the right one will move relative to the right edge of the control, and the track bar will resize itself to fit.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900