user2366092
user2366092

Reputation: 53

vb.net - Remove border around Progress-bar

How would i go about removing the thin border around the edges of the Progress-bar tool? There doesn't seem to be any properties to change the style. It looks like the default 3d border.

Upvotes: 1

Views: 1534

Answers (1)

It is not the best solution from a programmatically correct point of view, but it works and is an easy solution.

  • You create a Panel control
  • You put the BorderStyle property of the Panel to None
  • You moove your Progress Bar inside the Panel control
  • You rezise the Panel and the Progress Bar so that dimension of the Progress Bar is a few pixels larger than the dimension of the Panel control. This way, when the controls are drawn, the borders of the Progress Bar do not show because they are outside of Panel control
  • You set the Anchors property of the Progress Bar to Left, Right, Top and Bottom so that when you rezise the Panel control, the Progress Bar inside resizes well.
  • You resize and place your Panel where you need it (and the Progress Bar will resize well into it)

And your done. As I said, it is not a nice solution from a programmation point of view, but overall it works well and allow you to do what you want without spending too much time.

Upvotes: 4

Related Questions