Resolved Masked amount(currency) textbox

Hi,

Have a read of this:-

how to format text box during input in vb.net - Stack Overflow

This is good advice which I would suggest you consider but if you do want/need to go down to route of formatting your TextBox "on the fly" then the example supplied, which is in C, is not perfect by a long shot. I can get to a slightly better solution myself, but it's still not perfect so I will not post it.

Hope that helps.

Cheers,

Ian
 
Thanks Ian,
I tried your suggestion it has bug, I made textalign right and tried again but it has problem... terrible
 
A MaskedTextBox is not great for currency because you have to have a constant number of character spaces between the currency symbol (assuming that it comes first) and the decimal point. You might like to use this custom control of mine instead:

Numeric Text Box
 
I found a Currency DLL and tested it well.
Just assignment enough to use it in the designer.

VB.NET:
Private Sub InitializeComponent()
        Me.TextBox1 = New CurrencyBox.CurrencyBox()
...
...
...
End Sub
Friend WithEvents TextBox1 As CurrencyBox.CurrencyBox

Thanks for replies
 
I won't take offence that you preferred that one over mine. ;)
I read a few comments on your topic which someone suggested something to fix and you looked agree with him. so have you fixed and revised the files?
Btw, how can I use them? They are just classes
 

Latest posts

Back
Top