I'm writing a code to build a advance calculator, I got everything BESIDES putting a message error that says: "Cannot divide by zero." in the dividebutton I just have a really hard time coding a message error...

Thanks!

Recommended Answers

    MsgBox("Cannot divide by zero", MsgBoxStyle.Critical)
Jump to Post

Or you can test the operands before you do the divide to see if the denominator is zero.

Jump to Post

All 5 Replies

    MsgBox("Cannot divide by zero", MsgBoxStyle.Critical)

Or you can test the operands before you do the divide to see if the denominator is zero.

commented: Life can be really simple. +14

I got it now, Thanks Luc001!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.