PC Review


Reply
Thread Tools Rate Thread

Dynamic creation of controls

 
 
Thomas
Guest
Posts: n/a
 
      14th Sep 2004
Hello all together,

I'm trying to combine a TCP Socket Connection with ONE Form to receive some
kind of XML documents containing elements that should be displayed as
controls (i.e. labels and textboxes for now).

The receiving of such xml documents and the parsing is not a problem, but
....

The Talker class is sending a notification to the form, containing the xml
doc as string.

Appearantly the Notificationhandler cannot call the
this.Controls.Add(control) method to add the control to the controls of the
form.

When I try this in the InitializeComponents() method of the form or on a
Push button I can dynamically create controls and display them, but not from
within the notification handler.

Am I doing something wrong or am I stupid ?

regards

Thomas


 
Reply With Quote
 
 
 
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      14th Sep 2004
The notificationhandler is on another thread, so you have to marshal calls
back to the UI thread and create from there.

-Chris


"Thomas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello all together,
>
> I'm trying to combine a TCP Socket Connection with ONE Form to receive

some
> kind of XML documents containing elements that should be displayed as
> controls (i.e. labels and textboxes for now).
>
> The receiving of such xml documents and the parsing is not a problem, but
> ...
>
> The Talker class is sending a notification to the form, containing the xml
> doc as string.
>
> Appearantly the Notificationhandler cannot call the
> this.Controls.Add(control) method to add the control to the controls of

the
> form.
>
> When I try this in the InitializeComponents() method of the form or on a
> Push button I can dynamically create controls and display them, but not

from
> within the notification handler.
>
> Am I doing something wrong or am I stupid ?
>
> regards
>
> Thomas
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic controls creation - issue Sri Microsoft ASP .NET 1 19th Jun 2006 10:09 AM
Creation of dynamic controls - Timers Jerry Spence1 Microsoft VB .NET 8 20th Aug 2005 01:24 PM
Bogues in IE ? : dynamic creation of controls Windows XP Internet Explorer 0 7th Jul 2004 04:43 PM
Dynamic creation of user controls Jill Graham Microsoft ASP .NET 1 25th Mar 2004 02:44 PM
dynamic creation of user controls Adie Microsoft ASP .NET 3 30th Dec 2003 03:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:16 PM.