Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27333

Form Load, Focus on multiple textboxes.

$
0
0
Well I have a formatted some textboxes to accept currency which is;

Try
'if theres nothing entered default it to 0.00
If txtTotalGPMA.Text.Length = 0 Then txtTotalGPMA.Text = "$0"
'convert the text to a value
Dim dblAmt As Double = Decimal.Parse(txtTotalGPMA.Text, Globalization.NumberStyles.Currency)
'convert it for display
txtTotalGPMA.Text = dblAmt.ToString("c0")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Invalid Amount")
End Try

End Sub

It is in the validating event.
Now I'm trying to on form load to set focus to all the textboxes rather then show blank spaces to show the currency symbol ($0).

Would this be achieved with a setfocus to loop through the textboxes then finish on the top textbox so the user can go ahead and type?

Viewing all articles
Browse latest Browse all 27333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>