473,484 Members | 1,697 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Cursor to end of line in textbox

I have a textbox on an ASP.NET webform (VB code behind). Is there a
way for me to set the cursor to the end of the line on a gotfocus call?
Right now I'm using the following to set the foucs to that textbox on
a keypress (given certain criteria). Thanks.

document.forms[0].myTextBox.focus()
// document.forms[0].myTextBox.EOL --- would be nice here : )

Or I could use it somewhere here when it actually gets the focus:

Page Load VB:
myTextBox.Attributes.Add("onfocus", "setGotFocus()")

javascript:
function setGotFocus()
{
// document.forms[0].myTextBox.EOL --- would be nice here : )
document.forms[0]['myTextBox'].value = myVariable
}

Aug 11 '06 #1
1 6220
DWS
try adding a space to the end of the text box and selecting it. Good luck
making it work on all browsers.

"Gyetko" wrote:
I have a textbox on an ASP.NET webform (VB code behind). Is there a
way for me to set the cursor to the end of the line on a gotfocus call?
Right now I'm using the following to set the foucs to that textbox on
a keypress (given certain criteria). Thanks.

document.forms[0].myTextBox.focus()
// document.forms[0].myTextBox.EOL --- would be nice here : )

Or I could use it somewhere here when it actually gets the focus:

Page Load VB:
myTextBox.Attributes.Add("onfocus", "setGotFocus()")

javascript:
function setGotFocus()
{
// document.forms[0].myTextBox.EOL --- would be nice here : )
document.forms[0]['myTextBox'].value = myVariable
}

Aug 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5032
by: Ramsin Savra | last post by:
Hi, I have below code, to move the cursor to a specific line in a text-box control (I don't want to use RichTextBox) but doesn't work! any suggestions? int charIndex = 1; for (int i = 0; i <...
1
3816
by: objectref | last post by:
Hi to all, we have the MousePosition property that we can get the Point of the position of the mouse cursor on the screen, but is it there a way to get the respective Point of a cursor in a...
0
1283
by: Peteroid | last post by:
I'm doing a managed C++.NET (2003) application where I use a Control::TextBox. When typing in text there is a cursor indicating the position of where typed in text will go next (typically, a...
22
4480
by: DraguVaso | last post by:
Hi, For my application I need the following behavior: When I press F4 the cursor has to move to the next line in my multiline textbox which begins with "0". Finding lines starting with 0 isn't...
13
3305
by: WALDO | last post by:
I have a .Net TextBox (TextBoxBase, really) in which I am appending about 20 lines of text per second. I use the AppendText() method to accomplish this. This is a great substitute for taking the...
3
11909
by: fbergroth | last post by:
Hi, I'm quite new to C# allthough I've been programming in other languages for quite a while. I'd like to change the blinking cursor inside a TextBox, I guess I must derive the class and...
0
1879
by: =?Utf-8?B?Q29yZXlNY0s=?= | last post by:
I'm working on a TextBox control (in C# using .NET 2.0) that allows fields (like MS Office's mail merge feature). I want the editor to treat the field as though it was a single character. The user...
4
64843
by: Brandon McCombs | last post by:
Does anyone know of an easy way to set the position of the cursor in a TextBox? If I set text in the box that is longer than the length of the TextBox the position of the cursor is at the very end...
2
2463
by: Jassim Rahma | last post by:
how can i change the cursor of the textbox to the block style?
0
7105
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7144
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6813
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4845
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4529
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3046
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1359
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
235
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.