0

I'm making an instant messaging application in C#. The problem that I'm facing right now is that for the contacts list I've made a custom control extendinguserControl, which contains aFlowLayoutPanel`.

That panel will contain a list of userControls. I want to customize the VscrollBar, but no chance (not possible). Instead I have this genius idea to hide the VscrollBar from the FlowLayoutPanel, and make simple buttons (UP and down events). For this everything worked like a charm, but when I tried to hide the VscrollBar by making the property autoScroll = false , the buttons stopped working.

How can I hide the VscrollBar?

JNYRanger
  • 6,829
  • 12
  • 53
  • 81
Youssef R.
  • 49
  • 1
  • 5

1 Answers1

0

If you want to hide the the vertical bar, there are some possible solutions. ..

  • You could make an event for resize, controls add, controls remove and set all the child controls' width to flowlayoutpanel.width -20
  • You could add a panel to the flowlayoutpanel and set it to autosize and make the panels may width to flowlayoutpanel.width-20.
  • You could check if the width of the flowlayoutpanel is bigger than its real width (means vscrollbar appeared) , and resize the children that it'll/ld hide again
  • and if you are sure that your controls are smaller than the flowlayoutpanel's width, you simply could create a panel which covers the vertical bar. (use .BringToFront() to put it before the flowlayoutpanel's scrollbar)

I hope that I understood and perhaps have solved the problem

leAthlon
  • 734
  • 1
  • 10
  • 22