|
-
Mar 24th, 2003, 05:40 AM
#1
Thread Starter
Lively Member
formatting numbers in textbox
i am using a normal textbox.
i want that it should remain in this format "0.00" all the time.
when the form opens, when the data loads in it, when the user leaves the textbox, etc.
Last edited by anis_b; Mar 24th, 2003 at 07:28 AM.
Anis Bombaywala
-
Mar 24th, 2003, 06:33 AM
#2
Fanatic Member
textbox
I am new to vb.net but you may want to check out the placing the format in form_load event and the textbox_leave event or something similar?
-
Mar 24th, 2003, 06:25 PM
#3
Sleep mode
Re: textbox
put this in the load_form event of your form !
-
Mar 24th, 2003, 07:19 PM
#4
Lively Member
Use the mamask.ocx from system32 folder it looks like a text box
and you can format how you whant in the help in vb.net there is good info,
-
Mar 24th, 2003, 07:25 PM
#5
Sleep mode
Originally posted by cgj
Use the mamask.ocx from system32 folder it looks like a text box
and you can format how you whant in the help in vb.net there is good info,
huh ?
-
Mar 24th, 2003, 09:34 PM
#6
PowerPoster
Don't use an OCX, that is a COM control. You want to avoid using them in .Net as much as possible.
You can use something like this. The first value is the text you want formatted.
text1.text = format("21.22","Currency")
or check this link for a control you can easily use:
http://www.c-sharpcorner.com/winform...dTextBoxJP.asp
-
Mar 24th, 2003, 11:16 PM
#7
Lively Member
hi hellswraith
Well i didn't program before .net,
What is wrong with com in .net?
-
Mar 24th, 2003, 11:24 PM
#8
PowerPoster
You can do it, but .Net will create a COM wrapper class around it, and make calls to it, which in turn makes calls to the COM object. This would be slower than using something native to the .Net framework.
Sometimes you can't get around it....and that is alright. Just try not to use COM if you can help it. The general rule is to make sure there is no .Net way of doing it before using COM.
Also, I have found some problems with COM classes myself. Sometimes methods don't work as they should. That just is my experience.
Hope that helps.
-
Mar 24th, 2003, 11:40 PM
#9
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|