473,890 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get the width of VSCrollBar for RichTextBox ?


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

Jun 3 '06 #1
1 2115

You can call the GetScrollBarInf o 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.
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Polaris" <et*******@hotm ail.com> wrote in message
news:OG******** ******@TK2MSFTN GP02.phx.gbl...

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


Jun 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Gawelek | last post by:
I would like to "cheat" VScrollBar in DataGrid. That means I want to link for example DataTable with 50 rows to DataGrid. But I want, that VScrollBar looks as if DataTable contains for example 100 or 1000 rows. Is it possible to do ? I tried by Maximum properties, but it seems not to work. Gawel
by: Durand | last post by:
Hi all, I'm trying to create a vScrollBar with a dynamic value. When I change the maximum value inside a method, it works inside a method, but when I leave this method the maximum value returns to previous value. My vScrollBar is not declared inside any method. Thanks Durand
by: Hans [DiaGraphIT] | last post by:
Hi! In a windowsapplication i have a datagrid where I dont want the vertical scrollbar to be visible. I can't find HorizontalScrollBar and VerticalScrollBar properties anywhere. I've tried to create controls for this... without luck. Here is the code I'm using. Please tell me what I'm doing wrong. this.InitializeScrollBar(DataGrid1)
by: bleedledeep | last post by:
I have a DataGrid that ends up with a VScrollBar due to the number of rows, and the behavior I want is for the bottom-most row of the DataGrid to be shown, i.e., I want the VScrollBar all the way to the bottom (maximum). I grab and set the VScrollBar using the following: if ( historyDataGrid.Controls is VScrollBar ) { VScrollBar vsb = (VScrollBar)historyDataGrid.Controls;
by: Sascha Schmidt | last post by:
Hello ! I'm trying to combine an external (not part of the panel) vertical scrollbar (VScrollBar) with a panel in order to scroll the content of the panel vertically using the external VScrollbar. I can't set the "AutoScroll"-property to true and then use the generated scrollbars inside the panel, because i have to use this external scrollbar which is a modified/customized scrollbar, and doesn't look like a standard scrollbar.
by: Rachel Suddeth | last post by:
I would like to load a file to the .Rtf property of a RichTextBox, and then set the containing form (if possible, depending on screen resolution) to the smallest width that will not cause the horizontal scrollbar to appear. Now the RichTextBox must know what width will cause the horizontal scrollbar to disappear because, after all, the scrollbar does disappear if you make it wide enough (the RichTextBox is docked to the form.) Any idea...
by: Venkatachalam | last post by:
Hello, I am reading a Column form the DataTable and have to display in the RichTextBox/TextBox (With Multi-line). When I try to do so: The width occupied by each charaters are not same and that causes column alignment problem. For ex.
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm using the System.Windows.Forms.VScrollBar on my form. I'm handling VScrollBar Scroll event. I want to handle the Up, Down, PageUp PageDown keys for this VScrollBar, but when I register to the keyDown and KeyPress events, it never gets there. So I also handled the key events of the form and from there I forwarded the event to the VScrollBar corresponding event, but still the VScrollBar events in never invoked. What should I do so...
by: Longkhi | last post by:
Hi everybody. I have quite a problem with the vscrollbar component. The control I'm using has a built-in scrollbar, but I have 5 of those controls, and I would like to bind the external vscrollbar to scroll them all synchronically. I have tried several other methods such as the wndProc override method. It didn't work, so I'm trying this alternative method.
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.