Loop through all binding sources on a form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Sheppard

    #1

    Loop through all binding sources on a form

    Hello there,

    I was wondering if anyone knew how to loop through all binding sources on a
    form?

    I tried the below code but the me.controls collection doesnt return
    everything :(
    For Each obj As Object In Me.Controls

    If TypeOf (obj) Is BindingSource Then

    MessageBox.Show (obj.name)

    End If

    Next



    Thank you kindly for reading my message

    John Sheppard


  • Cor Ligthert[MVP]

    #2
    Re: Loop through all binding sources on a form

    John,

    You need the me.bindingmanag er for this, however I could not find in a
    reasonable way (I am at home now) good information about this on MSDN.
    Maybe you can try it yourself.

    Cor

    "John Sheppard" <spam@nospam.co mschreef in bericht
    news:fu3mbb0t0@ news2.newsguy.c om...
    Hello there,
    >
    I was wondering if anyone knew how to loop through all binding sources on
    a form?
    >
    I tried the below code but the me.controls collection doesnt return
    everything :(
    For Each obj As Object In Me.Controls
    >
    If TypeOf (obj) Is BindingSource Then
    >
    MessageBox.Show (obj.name)
    >
    End If
    >
    Next
    >
    >
    >
    Thank you kindly for reading my message
    >
    John Sheppard
    >
    >

    Comment

    • John Sheppard

      #3
      Re: Loop through all binding sources on a form

      Thanks cor...

      There is no me.bindingmanag er? Do you mean that I should be using the
      bindingmanager component instead of a binding source?

      I never have any luck with MSDN, I only ever seemed to find technical but
      usless information there...always found google to be more useful...

      Thank you
      John

      "Cor Ligthert[MVP]" <notmyfirstname @planet.nlwrote in message
      news:31C292A6-422E-4383-A275-61433AA1F81A@mi crosoft.com...
      John,
      >
      You need the me.bindingmanag er for this, however I could not find in a
      reasonable way (I am at home now) good information about this on MSDN.
      Maybe you can try it yourself.
      >
      Cor
      >
      "John Sheppard" <spam@nospam.co mschreef in bericht
      news:fu3mbb0t0@ news2.newsguy.c om...
      >Hello there,
      >>
      >I was wondering if anyone knew how to loop through all binding sources on
      >a form?
      >>
      >I tried the below code but the me.controls collection doesnt return
      >everything :(
      >For Each obj As Object In Me.Controls
      >>
      >If TypeOf (obj) Is BindingSource Then
      >>
      >MessageBox.Sho w(obj.name)
      >>
      >End If
      >>
      >Next
      >>
      >>
      >>
      >Thank you kindly for reading my message
      >>
      >John Sheppard
      >>
      >>
      >

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Loop through all binding sources on a form

        John,

        I could not come on the class either this morning, it is the
        bindingmanagerb ase and the me.bindingconte xt.

        Here you find some more infomration.

        http://msdn2.microsoft.com/en-us/lib...ngcontext.aspx

        Cor

        "John Sheppard" <spam@nospam.co mschreef in bericht
        news:fu488c0inp @news2.newsguy. com...
        Thanks cor...
        >
        There is no me.bindingmanag er? Do you mean that I should be using the
        bindingmanager component instead of a binding source?
        >
        I never have any luck with MSDN, I only ever seemed to find technical but
        usless information there...always found google to be more useful...
        >
        Thank you
        John
        >
        "Cor Ligthert[MVP]" <notmyfirstname @planet.nlwrote in message
        news:31C292A6-422E-4383-A275-61433AA1F81A@mi crosoft.com...
        >John,
        >>
        >You need the me.bindingmanag er for this, however I could not find in a
        >reasonable way (I am at home now) good information about this on MSDN.
        >Maybe you can try it yourself.
        >>
        >Cor
        >>
        >"John Sheppard" <spam@nospam.co mschreef in bericht
        >news:fu3mbb0t0 @news2.newsguy. com...
        >>Hello there,
        >>>
        >>I was wondering if anyone knew how to loop through all binding sources
        >>on a form?
        >>>
        >>I tried the below code but the me.controls collection doesnt return
        >>everything :(
        >>For Each obj As Object In Me.Controls
        >>>
        >>If TypeOf (obj) Is BindingSource Then
        >>>
        >>MessageBox.Sh ow(obj.name)
        >>>
        >>End If
        >>>
        >>Next
        >>>
        >>>
        >>>
        >>Thank you kindly for reading my message
        >>>
        >>John Sheppard
        >>>
        >>>
        >>
        >
        >

        Comment

        • John Sheppard

          #5
          Re: Loop through all binding sources on a form

          Thanks heaps cor...this looks like it might do the job, I will work through
          it

          Kind Regards
          John Sheppard

          "Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
          news:u$zxH66nIH A.4832@TK2MSFTN GP02.phx.gbl...
          John,
          >
          I could not come on the class either this morning, it is the
          bindingmanagerb ase and the me.bindingconte xt.
          >
          Here you find some more infomration.
          >
          http://msdn2.microsoft.com/en-us/lib...ngcontext.aspx
          >
          Cor
          >
          "John Sheppard" <spam@nospam.co mschreef in bericht
          news:fu488c0inp @news2.newsguy. com...
          >Thanks cor...
          >>
          >There is no me.bindingmanag er? Do you mean that I should be using the
          >bindingmanag er component instead of a binding source?
          >>
          >I never have any luck with MSDN, I only ever seemed to find technical but
          >usless information there...always found google to be more useful...
          >>
          >Thank you
          >John
          >>
          >"Cor Ligthert[MVP]" <notmyfirstname @planet.nlwrote in message
          >news:31C292A 6-422E-4383-A275-61433AA1F81A@mi crosoft.com...
          >>John,
          >>>
          >>You need the me.bindingmanag er for this, however I could not find in a
          >>reasonable way (I am at home now) good information about this on MSDN.
          >>Maybe you can try it yourself.
          >>>
          >>Cor
          >>>
          >>"John Sheppard" <spam@nospam.co mschreef in bericht
          >>news:fu3mbb0t 0@news2.newsguy .com...
          >>>Hello there,
          >>>>
          >>>I was wondering if anyone knew how to loop through all binding sources
          >>>on a form?
          >>>>
          >>>I tried the below code but the me.controls collection doesnt return
          >>>everything :(
          >>>For Each obj As Object In Me.Controls
          >>>>
          >>>If TypeOf (obj) Is BindingSource Then
          >>>>
          >>>MessageBox.S how(obj.name)
          >>>>
          >>>End If
          >>>>
          >>>Next
          >>>>
          >>>>
          >>>>
          >>>Thank you kindly for reading my message
          >>>>
          >>>John Sheppard
          >>>>
          >>>>
          >>>
          >>
          >>
          >
          >

          Comment

          Working...