|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
vb.net 2003 Formatting ... aghhhhhhhhhhhhhhhhhi need help, im at my wits end, carnt for the life of me understand whats
wrong I have written private sub to handle validating of text boxes Private Sub Handles_Validating(ByVal source As Object, ByVal e As EventArgs) _ Handles textbox1.validated , ??? .etc Dim tx As TextBox = DirectCast(source, TextBox) tx.Text = Format(Microsoft.VisualBasic.Right("000000" + tx.Text, 6), "0#-##-##") Why oh why when entering in 123456 do i get 0#-##-## instead of 12-34-56 ??? HELP !!!!!! Peter Newman wrote:
> Dim tx As TextBox = DirectCast(source, TextBox) "0" and "#" only work when formatting /numbers/ - you're passing it a > tx.Text = Format(Microsoft.VisualBasic.Right("000000" + tx.Text, 6), > "0#-##-##") > > Why oh why when entering in 123456 do i get 0#-##-## instead of > 12-34-56 ??? HELP !!!!!! /String/. Without going all ".Net-y" on you, try this: tx.Text = Format(Val(tx.Text), "0#-##-##") HTH, Phill W.
How to convert a Byte() to an IntPtr in VB
load form in vb.net How to raise a shortcut picking off each digit of an integer How to use binary files as resources in VB 2005 Regex.Split... Can I do this?? control array with code added controls Re: What .NET classes are SLOW vs. API? Getting external IP Address Is there a equivalent to 'Last Position' in VS2005? |
|||||||||||||||||||||||