Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




VB6 TextBox ScrollBar Get/update Position


I am limited to using vb6 here and was wondering if there was a way that I could update the scroll position to go to the last line of the current text box (I basically have a CR/LF delimited TextBox and want to keep the focus on the last line printed as lines are added (versus staying on the first line as it does currently)...is there anyway to do such a thing? My searches only yielded results for rich text fields etc. any help is appreciated.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
MDI Scrollbar Position
Hi!

I am quite new at Visual Basic programming, so I apologize in advance if this is a simple question.

Ok, here goes:

I want to create an MDI application with one child form. However, the child form is so large that it will cause a scrollbar to automatically appear. This is not the problem.

The problem is I don't want the child form to be viewed in the upper-left corner at start-up.
In other words, I want to be able to change the viewing portion of the child form, possibly the scrollbar positions. Am I making sense?

Also, I want the form to "follow" the scrollbars as I scroll. Right now, the form will move only AFTER I have released the mousebutton from the scrollbars.

Right, almost forgot: I use Visual Basic 6 Professional Edition when programming.

Can anyone help me?

// Thanks in advance!

Get/Set Scrollbar Position
Hi all,

I want to create a multiple "Undo"-function using a RichTextBox control. Therefore I save the "Text" property (the built-in "Ctrl-Z" works only once) as well as the current cursor position (SelStart-property).

Now when somebody selects "Undo", I restore the previously saved text and set the SelStart-property to its previous value. But there is no property to save and restore the previous position of the scrollbars.

Problem:
Imagine you are on the top of the window (but not on the top of the text) and delete something. Now you select "undo" and what happens is the following:

After replacing the current text with the old one, the cursor is located at the beginning of the text. Setting the "SelStart" property to its previous value makes the text scroll down just far enough to display the cursor position. The visible effect for the user is, that the current input position jumps from "top of window" to "bottom of window". I can only avoid this if I can make the scrollbar return exactly to its original position.

Does anybody know a way to solve this?

Thanks in advance
Udo


VB6 Listview: Vertical Scrollbar Position
Hi,
I'm using a listview with two columns to display items from a file, the listview control adds all my data but each time i "refresh" it the vertical scrollbar automatically adjusts itself to the centre. ie. skipping the first items and showing all the items in the centre by default. How can i rectify this?

Thanks

How To Bring The RichTextBox Vertical Scrollbar To Lowest Position ?
Hi all . i am adding data to richtextbox and want the scrollbar to move to lowest position each time data get entred. Could you any show me how that can be done.Thabnks


2 Code:
form1.RichTextBox1.Text = ChatText$

MSFlexGrid Scrollbar Does Not Update Current Row
Hello,

While implementing the msflexgrid in an activeX control I noticed another deficiency that I am trying to correct. Whenever the scrollbar (vertical) is used I have no notification so that I can cordinate the rest of my code. I have tried hooking into the control itself but I dont see any window messages proccing when the scrollbar is clicked on or moved. I do get messages when I click on the grid cells so it should not be in the hook routines.

Anyone have any clue into how I can monitor and respond to a user using the scrollbar?

Thanks!

MDIForm Scrollbar-update After Form.move
Using Visual Basic 6, how do I update the display of the scrollbars of an MDIForm
after I moved one of its child-forms with form.move?
The scrollbar scrollbar seems to move and resize it just isn't displayed correctly.

UPDATE-Value Passed From Listbox To Textbox Will Not Update :(
Have a slight problem here...

I have a form with 1 text box, 1 listbox and 1 button (an Update button)...


My code gets the value the user has clicked in the listbox and displays it in the textbox

But when I click update - it does NOT update the field by storing the new value which has just been passed to the textbox


However, if I type a value into the text box manually and click Update it updates the field just fine!!!
Why would this be???


I have tried using both the .Update method and the SQL INSERT INTO statements, but neither are making any difference!



Can anyone please help?


Thanks

UPDATE-Value Passed From Listbox To Textbox Will Not Update :(
Have a slight problem here...

I have a form with 1 text box, 1 listbox and 1 button (an Update button)...


My code gets the value the user has clicked in the listbox and displays it in the textbox

But when I click update - it does NOT update the field by storing the new value which has just been passed to the textbox


However, if I type a value into the text box manually and click Update it updates the field just fine!!!
Why would this be???


I have tried using both the .Update method and the SQL INSERT INTO statements, but neither are making any difference!



Can anyone please help?


Thanks

Textbox Scrollbar Help
Is it possible to change the colour of a textbox's scrollbars? Is it also possible to make the scrollbars appear and dissappear when the text is longer than the box? Finally, how do I get a centre of a textbox to follow the mouse? (Eg. So a user can redesign the interface if they want to by clicking and dragging)

Textbox + Scrollbar
let say if i am creating an app for which user can enter the degree desired (0-180deg).
i created a textbox(text1) and scrollbar(HScroll1) for user to enter the value. so, my question is can the value for both textbox and scrollbar matching each other?
that means when user enter 75deg in the textbox, the scrollbar will also automatically indicate 75deg...
when user scroll to 180deg, the textbox will shown 180...etc...

how can it be done?

TextBox And Scrollbar
Assume a textbox control is multiline with vertical scrollbar.

Whenever, I update the textbox with some text, the scrollbar will always scroll back to the top. Is is possible to scrollbar scroll to the bottom instead?? So, the user can see the latest update at the bottom!

Thanks.

Textbox With Scrollbar?
I have this question:

I load some text from a textfile into a textbox.

The textbox has a specific hight, when the textfile is getting larger from amount {It saves data every time}, it can happen the textbox isnt big enough in height anymore.

How to fix this?

Thank you in advance

Scrollbar In Textbox
Dear All,
How to scroll two textboxes(txtbox1,txtbox2 ) simultaneously.That is if i scroll the txtbox1 then txtbox2 automatically and viceversa.

TextBox Scrollbar
Folks,

In VB6, I use a textbox with multiline and vertical scrollbar to show a runtime process log. During the process or after it is done, the scrollbar's position stays at the top, that is, the text box shows the beginning of the log all the time.

How can I make it scroll down continuouly during the process and stays at the bottom showing the end of textbox?

Jeff

Scrollbar In Textbox
I have a problem with the scrollbars in a text box. Its a simple chat program and when the chat goes past the limits of the text box the scroll bar will come on and you can scroll down but every time i send a chat the scroll bar goes all the way to the top and i have to scroll down again. anyone know how to fix that problem so i don't have to scroll down everytime i send or recieve a message?

           All your base are belong to me
               ( º)> ~ <(º.º)> ~ <(º )

ScrollBar In TextBox
I have TextBox wich displays several lines of text. Its height is enough to display 4 lines only. In case there are more than 4 lines I would like to add ScrollBar to the TextBox automatically. How can I do it?
Thank you
Vlad

Textbox Scrollbar
I have a textbox on a form with a vertical scrollbar setting. When the textbox updates from the database that I am linked to, the scrollbar returns scrolls to the top of the textbox. How do I get the scrollbar to scroll down to the end of the textbox once I have updated the textbox with new data from the database.
Thanks.

Textbox Scrollbar
I have a textbox on a form with a vertical scrollbar setting. When the textbox updates from the database that I am linked to, the scrollbar scrolls to the top of the textbox. How do I get the scrollbar to scroll down to the end of the textbox once I have updated the textbox with new data from the database.
Thanks.

Using A Textbox Scrollbar Without A Mouse
I have a second screen I am working with, which will not have a mouse available. Therefore I will not be able to click on the textbox's vertical scrollbar if the textbox contains too much text. I want to be able to detect if the textbox has a scrollbar (That being the textbox has too much text), and if so, be able to move it down with just the touch of a button.

Is there any way I can find out a value for the textbox if a scrollbar is there? Or if the scrollbar can move...

And then change the value so that the scrollbar moves down?

I know how to write the other codes (using a key), I also looked at pictureboxs and vscrolls, I wondered if I could do it this way instead. Appreciate the help, thanks...

Zack

Textbox Scrollbar Color
Is it possible to change the color of a textboxes scrollbar(s)? If so how?

Textbox Scrollbar Question
Is there any way to change the colors on the scrollbar of a regular text box (or even on a rich text box for that matter)?

Perhaps there is some API somewhere? I can't seem to locate much.

Thanks

TextBox's Scrollbar Handle
How to access the handle of a textbox scrollbars? so that you can control the scrollbars.

Menu Bar / Textbox Scrollbar
I have a couple of questions

1: Is it possible to change the color of the menu bar ya kno where you put
File Edit etc?

2: Is it also possible to change the color of the textbox scrollbar when you have it in, multiline mode?

Detecting If Textbox Needs A Scrollbar
Hey guys, I just had an issue on how I would go about detecting whether or not a textbox requires a scrollbar when the text goes out of view. I know it does this automatically, but I would like to be able to try and do this manually.

Does anybody know?

Show Scrollbar With TextBox...
Module
-------

VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongPrivate Declare Function ShowScrollBar Lib "user32" (ByVal hWnd As Long, ByVal wBar As Long, ByVal bShow As Long) As Long Private Type RECT    Left As Long    Top As Long    Right As Long    Bottom As Long    End Type    Private Const SB_VERT = 1    Private Const EM_GETFIRSTVISIBLELINE = &HCE    Private Const EM_GETLINECOUNT = &HBA    Private Const EM_GETRECT = &HB2


TextBox_KeyUp
---------------

VB Code:
Public Sub ShowScrollBars(theTextbox As VB.TextBox)Dim firstVisibleLine As LongDim r As RECT                                <--------- ERROR: User-defined type not definedDim numberOfLines As LongDim numberOfVisibleLines As LongDim rectHeight As LongDim lineHeight As LongDim hWnd As Long hWnd = theTextbox.hWnd firstVisibleLine = SendMessage(hWnd, EM_GETFIRSTVISIBLELINE, 0, 0)     If firstVisibleLine <> 0 Then            ShowScrollBar hWnd, SB_VERT, 1        Else            numberOfLines = SendMessage(hWnd, EM_GETLINECOUNT, 0, 0)            SendMessage hWnd, EM_GETRECT, 0, r            rectHeight = r.Bottom - r.Top            lineHeight = theTextbox.Parent.TextHeight("W") / Screen.TwipsPerPixelY            numberOfVisibleLines = rectHeight / lineHeight                    If numberOfVisibleLines < numberOfLines Then                    ShowScrollBar hWnd, SB_VERT, 1                Else                    ShowScrollBar hWnd, SB_VERT, 0                End If    End IfEnd Sub Private Sub Text_KeyUp(KeyCode As Integer, Shift As Integer)    ShowScrollBars TextEnd Sub


I have also tryed hWnd and didnt work either...

How Do I Link A Scrollbar To My Textbox?
Hello,

I have a textbox, text1. I have a vertical scrollbar, vscroll1. I want to link the scrollbar to my textbox. The scrollbar should control the textbox the way the scrollbar property of a textbox works - simply, scrolls the text. Is this possible? If so, please give me the code.

Private Sub VScroll1_Change()
Text1.Top = -VScroll1.Value + 1000
End Sub

The aboves scrolls the entire position of the textbox, not the text inside it.

Thanks.

Textbox Vertical Scrollbar - How Can I ?
I have a Multiline Textbox that is only one line high , ie it displays only one line of text at a time.

I want to display a Vertical scroll bar in this Text box , ONLY if there are many lines of text. If there is only one line of Text , I don't want the scroll bar.


Does anyone know how to do this ??

The Scrollbars and Multiline property are read only at run time.

TextBox Or RichTextBox? How To Set The Scrollbar?
Dear Friends,

Grettings. Wish to ask some questions on text box. Hope this won't bore you.

1. If I wish to set a particular line of text to be in different say blue and in bold font, is it I must use rich text box for doing so.

2. In fact, I wish to use a textbox as an accumulative status displaying control like that in CuteFTP. When the user click or change on a particular control on the form, an instruction message will be displayed in the textbox. But you know when the messages are too many, the new message can't be seen unless the user manually scroll the textbox vertical scrollbar (Scrollbars property set to true for vertical). Is there any way to ensure the newly coming up message can be automatically shown without deleting old history. That might be setting the scrollbars value at runtime, is it?

Any idea, please help.

Thanks a lot.

Assigning A Scrollbar To A Textbox...
Is it possible to assign a vertical scrollbar to a text box so that when the scrollbar is scrolled, the textbox reacts to it. I have already found a few ways to do this, but they are something like controlling the selstart of the textbox by a scrollbar that has the max value of len(text1.text). Actually, I would like even more to have something that I could put in a button (or two) and use them to scroll the textbox. And if possible, no selstart please...


-JR-

Textbox Scrollbar Woes
Hi,

I'm despartely trying to change the color of the scroll-bars which appear with the text box. The only way I know is... change the Windows color theme. Is there any other way to do this?

Textbox Scrollbar Color
Is it possible to change the color of a textboxes scrollbar(s)? If so how?

Moving The Scrollbar In A Textbox
is there any way to move the scrollbar in a textbox with a command?

Textbox Manipulation With A Scrollbar
I need to manipulate the contents of a textbox so that the last value can always been seen. How can I do this and do I need scrollbars to achieve this. Thanks.

Textbox Scrollbar End Of Text Question
hello everyone!

I searching the past few hours for an answer, but no luck! hope someone can answer this!

I created a simple multilne textbox with vertical scroll enabled.
When I input text manually everything works fine.

but when i tried to add text from a button it automatically sends the scrollbar to the start position instead of the bottom of the textbox which is what i'm looking for.


Code:
text1.text= text1.text & " test " & vbnewline

it adds the text but the scrollbar goes back to the top.

Any suggestion on to make stay at the bottom. this only happens when adding the text thru a command button.

Textbox Control Array With Scrollbar
hi i have a from that contains a textbox control inside a frame and i placed a scroll bar beside it. so at runtime it displays 9 textbox but what i did is that the height of the frame can just display 3 textboxes at a tiime. i need to scroll through the other 6 textboxes that is not visible to the frame. so whenever i click the scrollbar down, i can view the lower textboxes and while clicking the arrow up i can view the upper textboxes. pls help me..

Built-in Scrollbar Textbox Or Richtextbox
Hi,

I want to know if we can change the "size" of the scrollbar inside textbox or richtextbox control. (e.g. To make it "thinner" if the text area is small). Any api call or wm_message can do this?

Of course I can explicitly merge the textbox/richtextbox control with others HScrollBar and VScrollBar.

Vertical Scrollbar Not Working For Textbox
I am typing text in a textbox but when it extends beyond the height of the textbox no vertical scroll bar is displayed automatically. I even tried to insert one in design time but during run time its not scrolling when the text exceeds the textbox height.So what to do? Thank you.

Flat Scrollbar In Multiline Textbox
Hi,

I have a MultiLine Textbox with No Scrollbars. I want to Use the Flat Scrollbar Control with it.

Can anybody tell me how to do it ???

With Regards,
Raj

Reading Data In A Textbox By Using The Scrollbar
Hi,

I have a textbox field such that it is set to multiline. I wish to allow user to scroll through the text but they can't edit the textbox. I don't want to use the Locked property as the cursor is still in the textbox & this can cause confusion to the user thinking that the textbox is editable. Can anyone help ? Thanks in advance.

Excel VBA Multi-column List Box Scroll Bar Position Update
In Excel VBA I am using a multi-column list box that is bound to a range with the rowsource command. When there are more rows and columns in the range than can be viewed simultaneously, the list box automatically provides horizontal and/or vertical scroll bars. The problem is that whenever the content of a cell referenced by the rowsource is changed the horizontal and vertical scroll bars go back to the uppermost and leftmost positions.

If I am entering data into the cells through a text box and viewing the results through the list box, it becomes very confusing when the scroll bars keep resetting. Is there any way to force them to stay in their present position?

How To Make Scrollbar To Change The Number In Textbox?
hi if there is a scroll bar and a textbox in my form, I want to use the scroll to change number in the text box, let's say if I click the up at scroll bar and the textbox will disply 1 and if I click down at the scroll bar and the textbox will display 0.

any info would be appreciated!

thanks a lot!

Textbox Control Array With Vertical Scrollbar
Hi i created a form with textbox control array and a vertical scrollbar inside a frame.. how will i scroll the textbox control array? how will i be able to view all the textbox controls inside the frame using the scroll bar?

Horizontal Scrollbar Is Not Visible In Rich TextBox
Hi,
It's Kshipra, new member in VB forum.
My Question : for Rich TextBox
   I am reading a file in rich textbox that contains more than 2000 records. I set the multiline property to true & scrollbars property to 3 i.e. both . But still i am unable to get the horiontal scrollbar and also each line in the rich textbox must show single record i.e. one record in each line ,this is also a problem.
   
Thanks & rgds.
Kshipra

Position In A TextBox
Is there a way to get the position of the cursor before leaving a textBox control (in the lostFocus event probably) ?

Position My Textbox
RESOLVED**


When i run my program the frame2/textbox1 & scroll bar1 all position at the top left of my vbform. How do i get them to position where i actually have put them on my form....(i've copied this code below - i think i need to edit it )

Any help?
many thanks


VB Code:
Private Sub VScroll1_Change() Dim i As Long 'Don't try to update while the form is loading. If IsLoading Then Exit Sub For i = 0 To BOXES_VISIBLE - 1 Text1(i).Text = MyData(VScroll1.value - VScroll1.Min + LBound(MyData) + i) Next End Sub

Caret Position In Textbox
is there a control (textbox,rtf, etc) that will let me show the position of the caret within the box? or is there a function that i can use?

i just find it retarded that i can find out how many lines there are, and the control that im using allows me to highlight an individual line, but i cant find out what line the caret is on.

Single Out A Position In A Textbox
Hi all

Is it possible to assign to a variable, the character at a specific position in a textbox?
To clarify, I mean that if, say "3nT" was in the textbox, "3" would be in position 1, "n" in position 2 and "T" in position 3.

To expand on this, if the position in the textbox is blank (not blank due to a space, I mean there is no more text in the textbox) then the value assigned should be "NullVal".

HEre is what I'm trying to accomplish, in 'pseudo code':
(All variables are declared as public strings in a module)


Code:
Private Sub Command1_Click()
char1 = character in position 1 of Text1
char2 = character in position 2 of Text1
char3 = character in position 3 of Text1
char4 = character in position 4 of Text1
and so on, up to


Code:
char15 = character in position 15 of Text1
Any help is much appreciated, thanks in advance and for reading my question.

-3nt.

Position Of Cursor In Textbox
i am trying to create a simple html editor and was wondering what i would use to make it so when i would click a button and the textbox lost focus i could place text to where the cursor was originally in the textbox.

thank you.

TextBox Text Position
Hi,
i hope someone knows,
is there any way to determine which character is mouse cursor above in textbox control? I need that so it could produce tooltiptext for certain words in text.
Thanks.

Copyright 2005-08 www.BigResource.com, All rights reserved