Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 15th, 2005, 12:44 AM
Authorized User
Join Date: Mar 2005
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to pritz Send a message via Yahoo to pritz
Default Set cursor at specific location in text box


Consider a text box in which i am typing numbers only.when i type 100 then there should be automatically "," sign should appear for it i copied it to a string and after apending the sign i show 100, in text box but problem is when i type next number it should show me 100,0 but it show me 0100,?????????
can any one help that how to set the cursor after pasting the string in text box so that i can get 100,0 .

Old August 26th, 2005, 08:18 AM
Authorized User
Join Date: Oct 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts

Public Sub txtNumbers_OnChange()
    If IsNumeric(txtNumbers.text) Then
        txtNumbers.Text = FormatNumber(txtNumbers.Text,2)
    End If
End Sub

"A spirit with a vision is a dream with a mission"
Old August 29th, 2005, 08:24 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

Look up help for the SelStart property. It allows you to determine where in a field the cursor sits.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Old August 29th, 2005, 10:27 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts

I answered the same question in this same forum:



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't set text property of dynamic text box sreerajrs ASP.NET 1.0 and 1.1 Professional 1 May 31st, 2006 09:39 PM
Set cursor at specific location in text box pritz Beginning VB 6 1 August 15th, 2005 12:22 PM
Focussing on a specific text box Dilip Nagle General .NET 4 January 6th, 2005 02:16 PM
Text box and cursor in it (netscape) maz JSP Basics 0 September 9th, 2004 12:30 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.