C
Colin McGuire
Hello experts, this is a repost but I have been (much) more clear.
I want to know the position of the horizontal scrollbar in a textbox
as a percentage
- if the horizontal scrollbar is hard left,
I want to display 0% on the form.
- if the horizontal scrollbar is smack in the middle,
I want to display 50% on the form.
- if the horizontal scrollbar is 2/3rd along the X-axis,
I want to display 66% on the form.
- if the horozontal scrollbar is hard right,
I want to display 100% on the form.
etc.
I can't figure out how to do it and, currently, think it can't be
done.
These are the steps I have used to create my application.
1. Launch Visual Studio 2003 and create a new project
"Form1" will show.
2. Move the cursor to the toolbox, select a textbox, and
draw one on the form.
3. Go to the properties and set "Scrollbars" to "Horizontal",
"WordWrap" to "False", and "MultiLine" to "True"
4. Type in a sentence "the quick brown fox jumps over the
lazy dog..". Eventually the horizontal scrollbar will
appear.
Now how on earth do I get the current scrollbar position, and the
maximum position, to determine the percentage
(currentScrollbarPositionX/maxScrollbarPositionX)*100/1 ?
When I Google search microsoft.public.dotnet.languages.vb, no luck.
I'd rather have someone post "It can't be done" rather than the thread
sit there with one entry, mine So, can it be done?
Thanks, a desperate Colin !
I want to know the position of the horizontal scrollbar in a textbox
as a percentage
- if the horizontal scrollbar is hard left,
I want to display 0% on the form.
- if the horizontal scrollbar is smack in the middle,
I want to display 50% on the form.
- if the horizontal scrollbar is 2/3rd along the X-axis,
I want to display 66% on the form.
- if the horozontal scrollbar is hard right,
I want to display 100% on the form.
etc.
I can't figure out how to do it and, currently, think it can't be
done.
These are the steps I have used to create my application.
1. Launch Visual Studio 2003 and create a new project
"Form1" will show.
2. Move the cursor to the toolbox, select a textbox, and
draw one on the form.
3. Go to the properties and set "Scrollbars" to "Horizontal",
"WordWrap" to "False", and "MultiLine" to "True"
4. Type in a sentence "the quick brown fox jumps over the
lazy dog..". Eventually the horizontal scrollbar will
appear.
Now how on earth do I get the current scrollbar position, and the
maximum position, to determine the percentage
(currentScrollbarPositionX/maxScrollbarPositionX)*100/1 ?
When I Google search microsoft.public.dotnet.languages.vb, no luck.
I'd rather have someone post "It can't be done" rather than the thread
sit there with one entry, mine So, can it be done?
Thanks, a desperate Colin !