PC Review


Reply
Thread Tools Rate Thread

Controls in a different class than my Form

 
 
gbraux
Guest
Posts: n/a
 
      5th Sep 2006
Hello,

I have created a Forms.Control class that contains a method that
dynamiquely generate buttons (buttons params are arguments of the
method).

I'd like to call this method from my form (Form1), and have the
dynamiquely created button placed on my From1 ...

I tired some ways to have my two class communicating
(ControlCollections ...), but without success ...

Thanks for your help,

Guillaume,
>From Paris, FR.


 
Reply With Quote
 
 
 
 
Morten Wennevik
Guest
Posts: n/a
 
      5th Sep 2006
Hi,

How about

Button b = SomeClass.CreateButton(param1, param2, param2);
this.Controls.Add(b);

--
Happy Coding!
Morten Wennevik [C# MVP]
 
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
Update UI controls in Form class from another class Curious Microsoft Dot NET 2 24th Dec 2007 08:28 PM
update form controls from a class Grant Microsoft C# .NET 2 29th Apr 2005 02:32 PM
Updating form controls from another class? ORC Microsoft C# .NET 2 12th Jan 2005 09:25 PM
Trying to add controls to the main Form from another class James Dean Microsoft C# .NET 1 12th Apr 2004 09:20 AM
Access Form Controls From Another Class? Michael Ramey Microsoft C# .NET 3 19th Sep 2003 08:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:06 AM.