Help on modifying this code (Win Forms wizard)

  • Thread starter Tommy Holm Jakobsen
  • Start date
T

Tommy Holm Jakobsen

Hi,

I've been following this article, and got it working:
http://weblogs.asp.net/justin_rogers/articles/60155.aspx
(only article 1 in the series).

I've been trying to add validation to this, so when a user clicks the next
button, the current dialog is validated before displaying the next dialog. If
it's not valid, it should stay at the current dialog, asking the user to fix the
errors.

But I can't figure out how this can be done. Anyone who will have a look at the
article, and maybe come up with a suggestion on how this can be done?

Thanks in advance,
Tommy
 
T

Tommy Holm Jakobsen

Hi,

I've been following this article, and got it working:
http://weblogs.asp.net/justin_rogers/articles/60155.aspx
(only article 1 in the series).

I've been trying to add validation to this, so when a user clicks the
next
button, the current dialog is validated before displaying the next
dialog. If
it's not valid, it should stay at the current dialog, asking the user to
fix the
errors. [...]

I didn't bother to look at the article. But generally, validation is done
by handling the Validating event for any control that you want to
validate, and making sure that buttons that dismiss the dialog have their
CausesValidation property set as appropriate (for example, an "okay" or
"next" button would be set to "true", a "cancel" button would be set to
"false").

If that doesn't apply in this situation, you should be more specific as to
why.

Pete

Hi Pete,

CausesValidation is set to true for the next button. I think it's because it
raises the event to show the next dialog, before the validation. But I'm not
sure and I can't figure it out. Theres not much code in the article so it would
be rather fast to see how it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top