Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to simulate a key press(ctrl + end)?

Status
Not open for further replies.

bitshifter05

Programmer
Jul 15, 1999
13
US
In a program in which I am writing I my text box to scoll all the way to the bottom.&nbsp;&nbsp;You can do this manually by pressing ctrl+end.&nbsp;&nbsp;I want to make the program do this automaticly when the textbox change event happens.&nbsp;&nbsp;So that my multiline textbox with scroll bars automaticly scrolls to the bottom every time new information is entered.<br><br><br>Bitshifter<br>
 
Try using sendkeys &quot;{CTRL}+{END}&quot;<br><br><br>Shaiju George<br><A HREF="mailto:shaijug@email.com">shaijug@email.com</A>
 
you could always set the <FONT FACE=monospace><b>ListBox1.ListIndex</font></b> property to <FONT FACE=monospace><b>ListBox1.ListCount - 1</font></b> instead. <p>mr s. <;)<br><a href=mailto: > </a><br><a href= > </a><br>why does it never do what is says it does in the manual?
 
using the listindex property will automatically select the last item.&nbsp;&nbsp;If you don't want to select it, try this:<br><br>list1.topindex=list1.newindex <p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
The ideas about using a listbox are great the only problem is that all my code is written for a textbox and would take way too long to re-write for a listbox.&nbsp;&nbsp;Need to be able to scroll to the bottom of a textbox.&nbsp;&nbsp;CTRL + END does this using the keyboard how do I cause a keyboard interrupt and pass it the value for CTRL + END???????<br><br><A HREF="mailto:bitshifter05@yahoo.com">bitshifter05@yahoo.com</A><br>
 
Sendkeys &quot;{CTRL}+{END}&quot;, as Shaiju pointed out.<br>Sendkeys loads the keyboard buffer. <p> <br><a href=mailto:InterruptX@excite.com>InterruptX@excite.com</a><br><a href= Contingency Implementation</a><br>Send me suggestions or comments on my current software project.
 
alt255&nbsp;&nbsp;I tried this and I got a run time error of invalid parameters. VB did not like &quot;{CTRL}+{END}&quot; <br>Any help please I know I am close and I think this will work.<br><br><A HREF="mailto:Bitshifter05@yahoo.com">Bitshifter05@yahoo.com</A>
 
Thanks all,<br><br>Sendkeys &quot;^{END}&quot;<br><br>worked great<br>
 
Sorry about that, bitshifter. Thanks for the correction, Jim.<br>I'll have to start reading my responses before I post them.<br><br>Apologies all around. <p> <br><a href=mailto:InterruptX@excite.com>InterruptX@excite.com</a><br><a href= Contingency Implementation</a><br>Send me suggestions or comments on my current software project.
 
<b><FONT FACE=monospace>SendKeys</b></font> is pretty much always the wrong way to do it since it sends the keystrokes to the app on top.<br><br>sorry to have misread the post, to scroll to the end of a textbox set the <b><FONT FACE=monospace>TextBox1.SelStart</b></font> property to <b><FONT FACE=monospace>Len(TextBox1.Text)</b></font>. <p>mr s. <;)<br><a href=mailto: > </a><br><a href= > </a><br>why does it never do what is says it does in the manual?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top