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

Multiple Text Boxes Exception Handling

$
0
0
Hi, i am pretty new to VB and i know this may be a simple question. please help. I have multiple text boxes that i need to validate for for numeric data. I want to return the focus for the specific text box, that is causing the problem, and select all. My code right now returns the focus to the last text box only. I cant figure out how to do it. here is my code.


Catch EX As FormatException
MessageBox.Show("Data must be Numeric.", "Data Entry Error", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)


With MonthlyGrossTextBox
.Focus()
.SelectAll()

End With

With CharityTextBox
.Focus()
.SelectAll()

End With


With ExpensesTextBox
.Focus()
.SelectAll()

End With

With SavingsTextBox
.Focus()
.SelectAll()

End With

With InvestmentsTextBox
.Focus()
.SelectAll()

End With
End Try

Viewing all articles
Browse latest Browse all 27184

Trending Articles



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