dcsimg
Results 1 to 4 of 4

Thread: [RESOLVED] Correct way to use error provider?

  1. #1

    Thread Starter
    Frenzied Member schoemr's Avatar
    Join Date
    Apr 2016
    Location
    South Africa
    Posts
    1,141

    Resolved [RESOLVED] Correct way to use error provider?

    Hi,

    I make use of error providers to do some data validation.

    On the same form with multiple textboxes, what is the correct way?

    Each textbox have own error provider:

    Me.ErrorProvider1.SetError(Me.TextBox1, "Some text")
    Me.ErrorProvider2.SetError(Me.TextBox2, "Some text")
    Me.ErrorProvider3.SetError(Me.TextBox3, "Some text")


    OR -------

    Same error provider for each textbox:

    Me.ErrorProvider1.SetError(Me.TextBox1, "Some text")
    Me.ErrorProvider1.SetError(Me.TextBox2, "Some text")
    Me.ErrorProvider1.SetError(Me.TextBox3, "Some text")


    Thanks...
    Don't miss the whole point of the dance...

    https://www.youtube.com/watch?v=qHnIJeE3LAI

  2. #2

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,486

    Re: Correct way to use error provider?

    Any class that implements IExtenderProvider, e.g. ErrorProvider, ToolTip or HelpProvider, gets used that way, i.e. one instance for everything. If you want a bit of a closer look at the inner workings of such a class, follow the CodeBank link in my signature below and check out my ControlArray thread.

  4. #4

    Thread Starter
    Frenzied Member schoemr's Avatar
    Join Date
    Apr 2016
    Location
    South Africa
    Posts
    1,141

    Re: Correct way to use error provider?

    Thank you very much Karen and John
    Don't miss the whole point of the dance...

    https://www.youtube.com/watch?v=qHnIJeE3LAI

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width