473,289 Members | 1,840 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,289 software developers and data experts.

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 2659
"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
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
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
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
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
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
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
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
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.