473,499 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vertical ScrollBar in RTB

In a Windows Form I have a RichTextBox with Multiline = True and
ScrollBars = Vertical. As expected, when Text is loaded into the RTB
the Vertical ScrollBar will appear if needed.

Does anyone know of a way (in Code) to determine if the Vertical
ScrollBar is visible or not? (VB 2005)

This question has been asked a couple of times over several months but
so far nobody has responded.

Thanks in advance to anyone who can provide assistance.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Jan 30 '07 #1
4 2670
"ShaneO" <sp****@optusnet.com.auschrieb:
In a Windows Form I have a RichTextBox with Multiline = True and
ScrollBars = Vertical. As expected, when Text is loaded into the RTB
the Vertical ScrollBar will appear if needed.

Does anyone know of a way (in Code) to determine if the Vertical
ScrollBar is visible or not? (VB 2005)
Check out my implementation that uses p/invoke:

<URL:http://dotnet.mvps.org/dotnet/samples/controls/ThemedRichTextBox.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jan 30 '07 #2
Herfried K. Wagner [MVP] wrote:
"ShaneO" <sp****@optusnet.com.auschrieb:
>In a Windows Form I have a RichTextBox with Multiline = True and
ScrollBars = Vertical. As expected, when Text is loaded into the RTB
the Vertical ScrollBar will appear if needed.

Does anyone know of a way (in Code) to determine if the Vertical
ScrollBar is visible or not? (VB 2005)

Check out my implementation that uses p/invoke:

<URL:http://dotnet.mvps.org/dotnet/samples/controls/ThemedRichTextBox.zip>
Thank-you for your link.

I was able to execute your application and I could see the results
(including the extra Properties).

The problem I'm having however is that I can't seem to implement your
code for the enhanced RTB. If I try I get -

"Namespace of type specified in the Imports
'ThemedRichTextBox.NativeMethods' doesn't contain any public member.....

I've added the files - "ExtendedRichTextBox.vb" and "NativeMethods.vb"
but can't do anything beyond that!

I'm also wondering, is it really necessary to add an enhanced control
just to achieve what I want? Surely there must be an easier way to find
out if a ScrollBar is visible or not?!?!?

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Jan 30 '07 #3
"ShaneO" <sp****@optusnet.com.auschrieb:
>>In a Windows Form I have a RichTextBox with Multiline = True and
ScrollBars = Vertical. As expected, when Text is loaded into the RTB
the Vertical ScrollBar will appear if needed.

Does anyone know of a way (in Code) to determine if the Vertical
ScrollBar is visible or not? (VB 2005)

Check out my implementation that uses p/invoke:

<URL:http://dotnet.mvps.org/dotnet/samples/controls/ThemedRichTextBox.zip>

I was able to execute your application and I could see the results
(including the extra Properties).

The problem I'm having however is that I can't seem to implement your code
for the enhanced RTB. If I try I get -

"Namespace of type specified in the Imports
'ThemedRichTextBox.NativeMethods' doesn't contain any public member.....

I've added the files - "ExtendedRichTextBox.vb" and "NativeMethods.vb" but
can't do anything beyond that!
Replace 'ThemedRichTextBox' in the 'Imports' statement contained in
"ExtendedRichTextBox.vb" with your project's root namespace
('WindowsApplication1' by default).
I'm also wondering, is it really necessary to add an enhanced control just
to achieve what I want? Surely there must be an easier way to find out if
a ScrollBar is visible or not?!?!?
Well, you don't need an inherited control, but it's a good solution because
it encapsulates the p/invoke calls and extends the control by handy
properties.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jan 31 '07 #4
Herfried K. Wagner [MVP] wrote:
>>
I've added the files - "ExtendedRichTextBox.vb" and "NativeMethods.vb"
but can't do anything beyond that!

Replace 'ThemedRichTextBox' in the 'Imports' statement contained in
"ExtendedRichTextBox.vb" with your project's root namespace
('WindowsApplication1' by default).
Doh! That was something that should have been obvious!
>I'm also wondering, is it really necessary to add an enhanced control
just to achieve what I want? Surely there must be an easier way to
find out if a ScrollBar is visible or not?!?!?

Well, you don't need an inherited control, but it's a good solution
because it encapsulates the p/invoke calls and extends the control by
handy properties.
Thank-you. Yes, the Extended Properties are something I could probably
take advantage of. Your help has been most valuable.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Jan 31 '07 #5

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

Similar topics

2
10994
by: Don Schneider | last post by:
I tried to setup a frameset which consists of 4 different subframes. Each of these subframes should fetch a different web page from the internet and display it completely (!). BUT: the vertical...
4
13539
by: Rob T. | last post by:
I am using a div tag to make an element that contains some text. I have specified overflow: auto; in my stylesheet. If I use font-size/line-height to specify the font information I get a vertical...
3
9875
by: buht | last post by:
Hello Everyone, Fairly new to c# here and have a question regarding scrollbars, particularly a vertical scrollbar. It looks like my options are restricted for the textbox scrollbars being...
0
2333
by: Gene Hubert | last post by:
I've got two treeviews side by side on a panel on a form. They each have about 20 nodes in them. The treeview on the right has a vertical scrollbar. The treeview on the left needs a vertical...
0
3556
by: jazeelkm | last post by:
hi, i am a beginer in the world of C# 1. I want to hide the vertical scrollbar of a listbox . In properties i can hide the horizontal scrollbar , but there s no option for vertical scroll...
1
5641
by: platoon1sc | last post by:
Hi guys.I have a problem with Internet Explorer in my web-application. I have a vertical scrollbar into my jsps but firefox show the vertical srollbar, but IE doesn't. IE show a blank space where...
1
3635
by: bai | last post by:
In my page, I have both horizontal and vertical scroll bars. I want to to some action on Vertical scrollbar click/move and some other action on horizontal scrollbar move/click. How to know whether...
1
13705
by: Tom | last post by:
First, I posted a similar request for help in another group and now don't find the posting. Problem with my newsreader perhaps ... but apologies if this appears as a cross posting. My code is...
0
7171
Oralloy
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,...
0
7220
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...
1
6893
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
7386
tracyyun
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...
1
4918
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...
0
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.