How to get the width of VSCrollBar for RichTextBox ?

P

Polaris

Hi:

I'm using a RichTextBox with C#. Just wondering how to get the width of the
Vertical Scroll Bar?

Thanks
Polaris
 
N

Nicholas Paldino [.NET/C# MVP]

Polaris,

You can call the GetScrollBarInfo API function through the P/Invoke
layer, getting the SCROLLBARINFO structure for the vertical scrollbar (you
have to pass in the handle of the rich text box. The rcScrollBar field will
have a rectangle which has the coordinates of the scrollbar. From this, you
can determine the size.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top