I need to create a panel to display a long radiobutton form with a scrollbar in VC++ (like the following picture). Since I have hundreds of radio buttons, I cannot show all at once. I need to use a scrollbar to control the current position of the radiobutton form. How I can make the scrollbar connect to the panel to do this task?

Writing code to synchronize a separate scroll bar control with a
Panelcontrol is possible, but it’s definitely the hard way of doing things.Instead, consider setting the
AutoScrollproperty of yourPanelcontrol totrue. When this property is enabled and the control has a virtual size larger than its visible boundaries, a scroll bar will automatically appear. Much easier.You can set this property either in the designer, or through code in your form’s constructor: