473,609 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ 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.focu s()
// 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.Attri butes.Add("onfo cus", "setGotFocus()" )

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

Aug 11 '06 #1
1 6226
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.focu s()
// 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.Attri butes.Add("onfo cus", "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
5056
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 < snpObject.edtTextBody.Lines.Length && i < iRequestedLineNumber - 1; ++i) { charIndex += snpObject.edtTextBody.Lines.Length;
1
3851
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 TextBox ?? (relative to screen) I mean, i have a textbox that i write some text and i want to know the exact point location of the cursor at any time a character is displayed.
0
1290
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 blinking vetical line-segment character). I need to either make this invisible or be able to control and read its position. How can I do this? Alternately, is there a way to force a TextBox to manage typing in a fractional number on its own so that...
22
4495
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 that difficult, but to find the next line is more difficult. For exemple: if my cursor is on line 200, it has to start searching on line 201, and not on line 1. Anybody has any ideas?
13
3324
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 Text property and concatenating it... Me.tb.Text &= newText ' Instead use Me.tb.AppendText(newText) ....ultimately setting the SelectionStart to the end of TextBox, the
3
11958
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 override the OnPaint()-method, however I have no clue what to do next. I want to be able to switch the blinking cursor to a solid, non-blinking, cursor and preferable have it with a color. So, how should I do that?
0
1885
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 shouldn't be able to delete part of the field or select only part of the field. For example, a line might look like: «Image» shot on «Date» at «Resolution» where «Image» «Date» «Resolution» are all fields. My control inherits from...
4
64865
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 of the line and a user would have to use the arrow keys to move it back to the beginning of the line of text. I'd prefer to set the cursor position automatically to just before the first character of the text. thanks
2
2479
by: Jassim Rahma | last post by:
how can i change the cursor of the textbox to the block style?
0
8047
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8510
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8376
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6975
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6044
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5503
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4006
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2515
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 we have to send another system
0
1372
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.