Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. VB.NET Framework 7, how to multithread on existing user control?

VB.NET Framework 7, how to multithread on existing user control?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpdatabasemysqldotnet
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_14155949
    wrote on last edited by
    #1

    I have about 6 user controls, each with its own GUI and code to load data from a MySQL database. Are there any tutorials or examples on how to use multithreading to load all 6 user controls on a Form when the Form is shown? Thanks in advance.

    D L 2 Replies Last reply
    0
    • M Member_14155949

      I have about 6 user controls, each with its own GUI and code to load data from a MySQL database. Are there any tutorials or examples on how to use multithreading to load all 6 user controls on a Form when the Form is shown? Thanks in advance.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Controls cannot be created and used on anything other than the UI (startup) thread. Your controls CAN, however, used Tasks or Threads to load data from the database, but populating the control data with the data returned from the database must be done on the UI thread. There are plenty of articles on the web about using tasks to get data. There is nothing specific to user controls that changes how that's done.

      Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
      Dave Kreskowiak

      1 Reply Last reply
      0
      • M Member_14155949

        I have about 6 user controls, each with its own GUI and code to load data from a MySQL database. Are there any tutorials or examples on how to use multithreading to load all 6 user controls on a Form when the Form is shown? Thanks in advance.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        What Dave said and use ObservableCollections to have the UC's update "live".

        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups