473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Getting TextBox scrollbar size

Hi,

Is there a way to:
1. Find out if a scrollbar is currently show on the TextBox
2. Get the width of the horizontal scrollbar

I am doing a UserControl with a TextBox with a small image placed in the upper right cornet of the
text box. If user typed a lot of text and scrollbar shows, i need to catch the event and move the
image left so that it will not be hidden by the scroll bar.

Any ideas would be highly appreciated!

Thank you,
Andrey
Nov 17 '05 #1
3 17169
"MuZZy" <le*******@yahoo.com> wrote in message
news:d6********************@comcast.com...
Hi,

Is there a way to:
1. Find out if a scrollbar is currently show on the TextBox
2. Get the width of the horizontal scrollbar

I am doing a UserControl with a TextBox with a small image placed in the
upper right cornet of the text box. If user typed a lot of text and
scrollbar shows, i need to catch the event and move the image left so that
it will not be hidden by the scroll bar.

Any ideas would be highly appreciated!


What properties have you got set on the textbox so that the scrollbar
appears automatically? I could only get it to either be there all the time
or never appear.

As for the width I think you can use

System.Windows.Forms.SystemInformation.VerticalScr ollBarWidth

Michael
Nov 17 '05 #2
Michael C wrote:
"MuZZy" <le*******@yahoo.com> wrote in message
news:d6********************@comcast.com...
Hi,

Is there a way to:
1. Find out if a scrollbar is currently show on the TextBox
2. Get the width of the horizontal scrollbar

I am doing a UserControl with a TextBox with a small image placed in the
upper right cornet of the text box. If user typed a lot of text and
scrollbar shows, i need to catch the event and move the image left so that
it will not be hidden by the scroll bar.

Any ideas would be highly appreciated!

What properties have you got set on the textbox so that the scrollbar
appears automatically? I could only get it to either be there all the time
or never appear.


TextBox.ScrollBars = Both/Horizontal/Vertical
When it's set to Both, it's automatic
As for the width I think you can use

System.Windows.Forms.SystemInformation.VerticalScr ollBarWidth
I will take a look, thank you!
Michael

Nov 17 '05 #3
"MuZZy" <le*******@yahoo.com> wrote in message
news:v-********************@comcast.com...
TextBox.ScrollBars = Both/Horizontal/Vertical
When it's set to Both, it's automatic


Don't know why but it's not automatic on my system. No matter what setting I
use the scrollbars just toggle between enabled and disabled. Maybe it's XP.

Michael
Nov 17 '05 #4

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

Similar topics

2
by: pothik05 | last post by:
I have a multiline textbox (with scrollbar) on a form. I add lines to the textbox at runtime. If the number of lines crosses the visible area in the textbox, I want the scrollbar to scrolldown. I...
5
by: MrNobody | last post by:
I have two large text boxes side by side which when loaded with text will usually get a horizontal scrollbar automatically. I would like to set it up so that when I scroll a bit to one direction...
6
by: tfs | last post by:
I am trying to display some data that is about 200 characters long and I was trying to display it on the screen in a textbox <asp:textbox /> But I don't want any borders. How would I...
1
by: Olav Tollefsen | last post by:
I have added a MultiLine TextBox to my aspx page: <asp:TextBox ID="TextBox1" runat="server" BorderStyle="None" ReadOnly="True" TextMode="MultiLine"></asp:TextBox> Then I add two lines of text...
22
by: Colin McGuire | last post by:
I apologize for posting yet another scrollbar question. Here is my code. All I want is for a diagonal line to appear from coordinates (0,0) to (width,height) in a usercontrol regardless of whether...
3
by: spielmann | last post by:
Hello I want to change the scrollbar size of windows, How can I do that with vb.net I have find this in VB6 but how can we convert simply this code. thx
0
by: d.steininger | last post by:
Hi there! Is there a way to bind a Textbox.Text to a ScrollBar.Value (not the Textbox-own Scrollbar) and vice versa? The Problem: I have to deal with two controls. The Textbox should accept...
1
by: Flack | last post by:
Hey guys, I have two questions regarding the vertical srollbar of a multiline textbox. 1. I have an "Ok" button that is initially disabled. I want it to be enabled when the user scrolls the...
3
by: Avi | last post by:
Hi all, I have a web page with Multiline TextBox. Every 3 seconds I refresh the page and display all received messages in this TextBox. When the TextBox is updated (The Text property is set). ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
jinu1996
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...
0
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...
0
agi2029
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.