By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,988 Members | 1,476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,988 IT Pros & Developers. It's quick & easy.

Text box formating in vb 6.0

P: 26
Hai, I wana to format a text box.

TextBox Name is txt_amount

So i want when the program in run mode then the text box has automaticly 0.00 will appear and when i worte any number then first 0 will delete and there will be my pressed number and when i press . point (.) then cursor will automaticly come after point and new neurmaric value will after the point.

i. e . 25.36
Dec 1 '07 #1
Share this Question
Share on Google+
5 Replies

Expert 100+
P: 487
Expand|Select|Wrap|Line Numbers
  1. SendKeys "{End}"
Dec 1 '07 #2

P: 26
Expand|Select|Wrap|Line Numbers
  1. SendKeys "{End}"

Hi would you please clear more
Dec 2 '07 #3

Mohan Krishna
P: 115
Hi godhulirbalaka!

May this help you...

Respond if it helps u
Attached Files
File Type: zip (1.7 KB, 177 views)
Dec 2 '07 #4

Expert 100+
P: 487
Good work Mohan Krishna. Let him try, Donot post Detail source code.

@godhulirbalaka : You can use mask textbox which is already formated as you require.
Dec 3 '07 #5

P: 180

if the length of the number to be input is fixed or known then use MaskEDBox instead. set its Mask Property to "99.99" this will display __.__ as input mask at run time. if the length of the text is not known you can try the method suggested by mohan krishna. or can use following code in the lost_focus event of the text box.

private sub text1_lostFocus()
text1.text = format(text1.text,"#0.00")
end sub

manpreet singh dhillon
Dec 3 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.