Hi Guys. First let me say that this site is fantastic and the knowledge spread is vast.

OK, now I'm somewhat of a noob when it comes to VB.net 2008 and have not long been coding with it. I came across a problem with the cancel button on an "input box". When the user clicks it, the program crashes. Is there any coding that I can use to stop this happening?

Many thanks and keep up the great work.

Red

Welcome Redserpent.

InputBox function returns zero length string if cancel button is clicked.

Test this code:

Dim m As String = InputBox("enter name : ")
 MsgBox(m.Length)

Hi Adatapost, thanks for the speedy reply. I will give your idea a shot.

Many thanks

Red

Hi Adatapost, thanks for the speedy reply. I will give your idea a shot.

Many thanks

Red

Thanks. Please mark this thread as Solved.

Be a part of the DaniWeb community

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