create and add control to form

  • Thread starter Alhambra Eidos Desarrollo
  • Start date


Alhambra Eidos Desarrollo

Hi all,

I need add several controls (Custom UserControls) to a Panel dinamically
(like Panel.Controls.Add(...)). This process can be slow, because each user
control contain one thumbnail of PDF file. The user control contains
Container of XPdfViewer (a COM library).

Can I create custom user controls (container, wrapper) in an another thread
and add it (add the control to main form) in Main Thread ??

For (i = 0 to Num Thumbnails)
1. Create control in Thread A

2. Add Control in Main Thread (UI)


I want to show to the user a message (waiting).

Thanks in advance, kind regards

Please, any sample good source code.



Cowboy \(Gregory A. Beamer\)

Try this:

You will want to look into asynchronous delegates so you can get the value
back from the thread and handle adding it to the Panel. There is probably
another way, but that is the first one that comes to mind.

BTW, you don't have to ask the same question numerous times, especially not
in this group, where there is a lot of activity. Either people will know or
they won't and duping questions with a different subject just tends to tick
off some of the people that answer. ;-)

Gregory A. Beamer


| Think outside the box! |

"Alhambra Eidos Desarrollo"

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