PC Review


Reply
Thread Tools Rate Thread

How to add a control to a form from a module and receive it's even

 
 
Nigel V Thomas
Guest
Posts: n/a
 
      31st Dec 2008
I have a module (mMain.vb) and want to dynamically create a form, add a few
controls and receive their events in the mMain.vb module.

1. I can create the from using DIM myfrm as new Form
2. I can add controls to the form using myfrm.addcontrol("ListBox")

But how can I receive the events back in my module

Any help appreciated

Nigel



 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      31st Dec 2008
Nigel V Thomas wrote:
> I have a module (mMain.vb) and want to dynamically create a form, add
> a few controls and receive their events in the mMain.vb module.
>
> 1. I can create the from using DIM myfrm as new Form
> 2. I can add controls to the form using myfrm.addcontrol("ListBox")
>
> But how can I receive the events back in my module


IMO, that's not a good idea. Why don't you put the code into the Form?


Armin
 
Reply With Quote
 
Nigel V Thomas
Guest
Posts: n/a
 
      3rd Jan 2009
Armin

Sorry for not getting back to u.

All sorted now.

What I was trying to do is create a reusable wizard form, to which I could
programatically add controls as need, but I have found a different way now

Thanks

"Armin Zingler" wrote:

> Nigel V Thomas wrote:
> > I have a module (mMain.vb) and want to dynamically create a form, add
> > a few controls and receive their events in the mMain.vb module.
> >
> > 1. I can create the from using DIM myfrm as new Form
> > 2. I can add controls to the form using myfrm.addcontrol("ListBox")
> >
> > But how can I receive the events back in my module

>
> IMO, that's not a good idea. Why don't you put the code into the Form?
>
>
> Armin
>

 
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
Form Control Update from Module =?Utf-8?B?VG9tX0I=?= Microsoft Dot NET Framework Forms 5 20th Oct 2005 01:33 PM
Design Best Practices: Form Control Code in Worksheet or Module =?Utf-8?B?QmluZw==?= Microsoft Excel Programming 2 23rd Dec 2004 02:31 PM
VB.NET: Receive string from the module and use it to the form Ken Tucker [MVP] Microsoft VB .NET 4 25th Sep 2004 07:48 PM
reference a vb.net windows form control from a module sub Mark D Microsoft VB .NET 2 25th Jun 2004 10:18 PM
Access ActiveX control on Form from Module Tim Microsoft VB .NET 0 22nd Mar 2004 08:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:39 PM.