Quantcast
Channel: If, Then, Else statement
Viewing all articles
Browse latest Browse all 4

If, Then, Else statement

$
0
0

 

HI there!

 

Pls. help me to make this condition:

 

Private

Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click

 

If tbxAmount.Text = ""Then  'code suppose to be print'

 

Else

Me.lblInWords.Text = NumToText((Double.Parse(Me.tbxAmount.Text)))

EndIf

EndSub

 

 

The condition is this:

If i put a blank value in the tbxAmount field the application will print with the blank value in the amount field of the check

and a blank value in the lblInWords field.

And if the value is correct then it will convert the amount to words (i have already the code for conversion into words)

then the application will print the tbxAmount field and the lblInWords field.

 

But if i mistaken to put a nonNumeric value then there will have a messagebox to give a warning that the value is not numeric. 

heres is my code but where i'm gonna be to put this?

 

IfNot IsNumeric(tbxAmount.Text) AndNot tbxAmount.Text = ""Then

tbxAmount.SelectAll()

MessageBox.Show(

"Please enter a numeric value")

tbxAmount.Focus()

Else

EndIf

 

 

thnx...


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images