Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Force Scroll Bar Down on TextBox Control

I have a text box which I am appending text to via code. I want the ability
to force the scroll bar down to the bottom each time the text is appended. I
put the following code into the AfterUpdate Event. However this event does
not fire when adding text via code. The only way I can get it to work is if
I change the Userform .Enabled property to FALSE. However this disables the
buttons on the userform. So then I tried to simply set the Enabled property
of the Textbox to FALSE. Howevever when I do this, the textbox does not
scroll nor are the scroll bars visible. How do I allow the user to scroll,
force the scroll bar to the bottom and not disable any button on the form?

Private Sub TextBox1_AfterUpdate()
On Error Resume Next
lLine = TextBox1.CurLine
TextBox1.CurLine = lLine
On Error GoTo 0
End Sub

Thanks

EM
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Force Scroll Bar Down on TextBox Control

Untested but can't you simply place the code to move the scroll bar
immediately after the code you are using to append and not rely on an event
to run the code.


--
Regards,

OssieMac


"Excel Monkey" wrote:

I have a text box which I am appending text to via code. I want the ability
to force the scroll bar down to the bottom each time the text is appended. I
put the following code into the AfterUpdate Event. However this event does
not fire when adding text via code. The only way I can get it to work is if
I change the Userform .Enabled property to FALSE. However this disables the
buttons on the userform. So then I tried to simply set the Enabled property
of the Textbox to FALSE. Howevever when I do this, the textbox does not
scroll nor are the scroll bars visible. How do I allow the user to scroll,
force the scroll bar to the bottom and not disable any button on the form?

Private Sub TextBox1_AfterUpdate()
On Error Resume Next
lLine = TextBox1.CurLine
TextBox1.CurLine = lLine
On Error GoTo 0
End Sub

Thanks

EM

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force to update textbox value to cell Ueli Werner Excel Programming 1 March 20th 09 02:30 PM
How to force smooth scroll in excel? The-trooper Excel Discussion (Misc queries) 1 March 4th 09 02:43 PM
How to force selection of all current text in textbox control onentry? Chrisso Excel Programming 2 November 25th 07 09:55 PM
How to move cursor from one textbox control to another textbox con Tom Ogilvy Excel Programming 1 September 16th 04 03:42 PM
How to move cursor from one textbox control to another textbox con KMoore007 Excel Programming 0 September 16th 04 02:47 PM


All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"