![]() |
Text Boxes
I am having trouble with text boxes. (Like you wouldn't have guessed from the title)
What I would like to happen is when a button is pressed the mouse cursor goes to the start of the line. (My text box has multi line enabled) The code I have used for the button press is: :
Private Sub Form_KeyPress(KeyAscii As Integer)I need the code for the cmdTime_click sub routine, which is also a command button. Thanks for looking :) |
Surely you mean I-bar, not the mouse cursor?
It's position and length are controlled by the selstart and sellength properties. You could count the number of line feed characters up to that point to determine the current line, and then set the position the hard way but why not just: :
Private Sub Text1_KeyDown(KeyCode as Integer, Shift as Integer) |
Grr evil host! (but +1 to my post count...)
|
Hi,
Thanks for your help. I am still having trouble. What i want to happen is when the user clicks a command button the time is pasted next to the time of lyric. (This i can do) However what i want to happen is for the I (Text Thing) to move down a line. I have tried using vbKeyDown but this does not work. Any ideas |
OK, I think this might be what you mean:
:
Private Sub Command1_Click() |
Hi,
I will try to explain what i mean more clearly. I am programming an application to create a synchronised lyrics file. I have a text box (txtLyrics.) In this user pastes thier lyrics. They then press the command button (cmdTime) which pastes the progress of the lyric at the start of the line. I then need the I Text cursor to goe down to the start of the next line. I am having trouble with the things in blue. Thank you for your time |
Ok, this should work then. When Command1 is clicked, it moves the I-Bar to the start of the 4th line (index of line is 3 as base 0) of text1.
:
Private Sub Command1_Click() |
| All times are GMT -5. The time now is 12:59 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC