473,378 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to create Event Handler for Dynamically added control

I am adding a new picturebox control at runtime on the form
How can i create click event handler for this control
Amit Shinde
Nov 20 '05 #1
15 26479
Use AddHandler

ie.

Addhandler Picturebox1.Click, Addressof
MethodorDelegateThathandlesclickandhassamesignitur e
..com
"Amit D.Shinde" <am*******@yahoo.com> wrote in message
news:9a*************************@posting.google.co m...
I am adding a new picturebox control at runtime on the form
How can i create click event handler for this control
Amit Shinde

Nov 20 '05 #2
"Amit D.Shinde" <am*******@yahoo.com> schrieb
I am adding a new picturebox control at runtime on the form
How can i create click event handler for this control


You can not create a handler at runtime, you have to write it at designtime.
You can _attach_ an event handler to an event: Addhandler myobject.theevent,
addressof handler
--
Armin

Nov 20 '05 #3
Armin,

hate to disagree with you here, but...

You can create a new delegate at runtime using the delegate class (it gets
tricky, but you can), and then you can bind events etc to the delegate to a
target method. And if you were so inclined (even though it seems like
overkill and no *real* use) you could

1) Load an assembly to grab an event out of...
2) Get the signiture of the event you want to hook (each event in .NET
automatically creates a delegate class at runtime, you have to watch your
assembly in debug to see it, but if you iterate through getTypes() you'll
see that there is a delegate created for the event.
3) Use CodeDom to create a class or whatever.
4) compile into a DLL
5) reference the newly created assembly
6) grab the method, use the delegate creator to hook the event and method.
7) Add Handler. =)

Now this is saying you do everything dynamically (including the creation of
a method). BUt you can simply hook to another method that matches the
signiture (depending on how strict you make it,you can check basetypes as
well to match sig.) And you can do this all dynamically at runtime. =)

-CJ

"Armin Zingler" <az*******@freenet.de> wrote in message
news:eA**************@TK2MSFTNGP10.phx.gbl...
"Amit D.Shinde" <am*******@yahoo.com> schrieb
I am adding a new picturebox control at runtime on the form
How can i create click event handler for this control
You can not create a handler at runtime, you have to write it at

designtime. You can _attach_ an event handler to an event: Addhandler myobject.theevent, addressof handler
--
Armin

Nov 20 '05 #4
"CJ Taylor" <no****@blowgoats.com> schrieb
Armin,

hate to disagree with you here, but...

You can create a new delegate at runtime using the delegate class (it
gets tricky, but you can), and then you can bind events etc to the
delegate to a target method. And if you were so inclined (even
though it seems like overkill and no *real* use) you could

1) Load an assembly to grab an event out of...
2) Get the signiture of the event you want to hook (each event in
.NET automatically creates a delegate class at runtime, you have to
watch your assembly in debug to see it, but if you iterate through
getTypes() you'll see that there is a delegate created for the
event.
3) Use CodeDom to create a class or whatever.
4) compile into a DLL
5) reference the newly created assembly
6) grab the method, use the delegate creator to hook the event and
method. 7) Add Handler. =)

Now this is saying you do everything dynamically (including the
creation of a method). BUt you can simply hook to another method
that matches the signiture (depending on how strict you make it,you
can check basetypes as well to match sig.) And you can do this all
dynamically at runtime. =)


Um....yes....you are right - but _I_ still prefer to write applications
at design time, not at run time. ;-)
--
Armin

Nov 20 '05 #5
how's that application going anyway cj?
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
Armin,

hate to disagree with you here, but...

You can create a new delegate at runtime using the delegate class (it gets
tricky, but you can), and then you can bind events etc to the delegate to a target method. And if you were so inclined (even though it seems like
overkill and no *real* use) you could

1) Load an assembly to grab an event out of...
2) Get the signiture of the event you want to hook (each event in .NET
automatically creates a delegate class at runtime, you have to watch your
assembly in debug to see it, but if you iterate through getTypes() you'll
see that there is a delegate created for the event.
3) Use CodeDom to create a class or whatever.
4) compile into a DLL
5) reference the newly created assembly
6) grab the method, use the delegate creator to hook the event and method.
7) Add Handler. =)

Now this is saying you do everything dynamically (including the creation of a method). BUt you can simply hook to another method that matches the
signiture (depending on how strict you make it,you can check basetypes as
well to match sig.) And you can do this all dynamically at runtime. =)

-CJ

"Armin Zingler" <az*******@freenet.de> wrote in message
news:eA**************@TK2MSFTNGP10.phx.gbl...
"Amit D.Shinde" <am*******@yahoo.com> schrieb
I am adding a new picturebox control at runtime on the form
How can i create click event handler for this control


You can not create a handler at runtime, you have to write it at

designtime.
You can _attach_ an event handler to an event: Addhandler

myobject.theevent,
addressof handler
--
Armin


Nov 20 '05 #6
Cor
> Um....yes....you are right - but _I_ still prefer to write applications
at design time, not at run time. ;-)

ROFL

Cor
Nov 20 '05 #7
Getting there. A great deal of the framework is done, I do have dynamic
event hooking completed which is really the core of it. Ironically I have
been documenting the whole thing too, which is a suprise for me... because I
usually don't. But figured if I'm going to hand this out to anyone, they
gotta see what I'm thinking with it.

But yeah, its getting there, I wanted to write a few more modules to test it
before I let it out on the public. Or the private public that is =)
Working with a user security module right now, and this is the thing I'm
struggling with, not because its hard, but I don't know what would be the
best way.

I could embed it into the framework and make things much easier. But that
just seems to defeat the purpose of a 100% scalable app (plus I have to redo
some of my dynamic event handling... forget that...) So I'm trying a few
things and see where it goes. I wanted to deliver the framework and a few
samples of how it works before I put it out.

So hopefully soon. I keep getting backlogged with old VB6 at work, these
things happen, so I've been off it for like 3 days. Blah.

The one thing I'm suprsed at is it is incredibly light weight and seems to
have some enourmous potential from what I see. Now obviusly I want to make
it more dynamic, but I think the most important thing is the visual event
linker I built. Which should help out with development because it handles
ALL event handling between plugins for you. And it's just implementing a
single interface.

SoThanks for asking, that actually felt good that someone rememberd. =)

I'll keep you informed.

CJ
"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
how's that application going anyway cj?
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
Armin,

hate to disagree with you here, but...

You can create a new delegate at runtime using the delegate class (it gets tricky, but you can), and then you can bind events etc to the delegate to
a
target method. And if you were so inclined (even though it seems like
overkill and no *real* use) you could

1) Load an assembly to grab an event out of...
2) Get the signiture of the event you want to hook (each event in .NET
automatically creates a delegate class at runtime, you have to watch

your assembly in debug to see it, but if you iterate through getTypes() you'll see that there is a delegate created for the event.
3) Use CodeDom to create a class or whatever.
4) compile into a DLL
5) reference the newly created assembly
6) grab the method, use the delegate creator to hook the event and method. 7) Add Handler. =)

Now this is saying you do everything dynamically (including the creation

of
a method). BUt you can simply hook to another method that matches the
signiture (depending on how strict you make it,you can check basetypes as well to match sig.) And you can do this all dynamically at runtime. =)

-CJ

"Armin Zingler" <az*******@freenet.de> wrote in message
news:eA**************@TK2MSFTNGP10.phx.gbl...
"Amit D.Shinde" <am*******@yahoo.com> schrieb
> I am adding a new picturebox control at runtime on the form
> How can i create click event handler for this control

You can not create a handler at runtime, you have to write it at

designtime.
You can _attach_ an event handler to an event: Addhandler

myobject.theevent,
addressof handler
--
Armin



Nov 20 '05 #8
If we could all only live in that perfect world where our applications where
next to godliness (which of course is next to cleanliness) and no one ever
wanted to create a new module or snapin to enhance the business logic.

I want to be there............
Buuuuuutttttt... not going to happen, so I work with the masses..



Oh yeah... I like doing it at design time too...

"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
"CJ Taylor" <no****@blowgoats.com> schrieb
Armin,

hate to disagree with you here, but...

You can create a new delegate at runtime using the delegate class (it
gets tricky, but you can), and then you can bind events etc to the
delegate to a target method. And if you were so inclined (even
though it seems like overkill and no *real* use) you could

1) Load an assembly to grab an event out of...
2) Get the signiture of the event you want to hook (each event in
.NET automatically creates a delegate class at runtime, you have to
watch your assembly in debug to see it, but if you iterate through
getTypes() you'll see that there is a delegate created for the
event.
3) Use CodeDom to create a class or whatever.
4) compile into a DLL
5) reference the newly created assembly
6) grab the method, use the delegate creator to hook the event and
method. 7) Add Handler. =)

Now this is saying you do everything dynamically (including the
creation of a method). BUt you can simply hook to another method
that matches the signiture (depending on how strict you make it,you
can check basetypes as well to match sig.) And you can do this all
dynamically at runtime. =)


Um....yes....you are right - but _I_ still prefer to write applications
at design time, not at run time. ;-)
--
Armin

Nov 20 '05 #9
are you kidding...you're working on something ver atl-ish AND
5gl-ish...kinda hard not to remember. what you've done w/ vb.net so far is
nearly impossible to do in vb6. i am compelled to remember and ask! this may
be your "dilbert-dead-possum" (explanation available upon request) project
but i find it fascinating.

do keep us posted!

steve

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
Getting there. A great deal of the framework is done, I do have dynamic
event hooking completed which is really the core of it. Ironically I have
been documenting the whole thing too, which is a suprise for me... because I usually don't. But figured if I'm going to hand this out to anyone, they
gotta see what I'm thinking with it.

But yeah, its getting there, I wanted to write a few more modules to test it before I let it out on the public. Or the private public that is =)
Working with a user security module right now, and this is the thing I'm
struggling with, not because its hard, but I don't know what would be the
best way.

I could embed it into the framework and make things much easier. But that
just seems to defeat the purpose of a 100% scalable app (plus I have to redo some of my dynamic event handling... forget that...) So I'm trying a few
things and see where it goes. I wanted to deliver the framework and a few
samples of how it works before I put it out.

So hopefully soon. I keep getting backlogged with old VB6 at work, these
things happen, so I've been off it for like 3 days. Blah.

The one thing I'm suprsed at is it is incredibly light weight and seems to
have some enourmous potential from what I see. Now obviusly I want to make it more dynamic, but I think the most important thing is the visual event
linker I built. Which should help out with development because it handles
ALL event handling between plugins for you. And it's just implementing a
single interface.

SoThanks for asking, that actually felt good that someone rememberd. =)

I'll keep you informed.

CJ
"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
how's that application going anyway cj?
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
Armin,

hate to disagree with you here, but...

You can create a new delegate at runtime using the delegate class (it gets tricky, but you can), and then you can bind events etc to the delegate to
a
target method. And if you were so inclined (even though it seems like
overkill and no *real* use) you could

1) Load an assembly to grab an event out of...
2) Get the signiture of the event you want to hook (each event in ..NET automatically creates a delegate class at runtime, you have to watch your assembly in debug to see it, but if you iterate through getTypes() you'll see that there is a delegate created for the event.
3) Use CodeDom to create a class or whatever.
4) compile into a DLL
5) reference the newly created assembly
6) grab the method, use the delegate creator to hook the event and method. 7) Add Handler. =)

Now this is saying you do everything dynamically (including the creation of
a method). BUt you can simply hook to another method that matches the
signiture (depending on how strict you make it,you can check basetypes as well to match sig.) And you can do this all dynamically at runtime.

=)
-CJ

"Armin Zingler" <az*******@freenet.de> wrote in message
news:eA**************@TK2MSFTNGP10.phx.gbl...
> "Amit D.Shinde" <am*******@yahoo.com> schrieb
> > I am adding a new picturebox control at runtime on the form
> > How can i create click event handler for this control
>
> You can not create a handler at runtime, you have to write it at
designtime.
> You can _attach_ an event handler to an event: Addhandler
myobject.theevent,
> addressof handler
>
>
> --
> Armin
>



Nov 20 '05 #10

"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
are you kidding...you're working on something ver atl-ish AND
5gl-ish...kinda hard not to remember.
I'm familar with atl, what is 5gl?
what you've done w/ vb.net so far is
nearly impossible to do in vb6. i am compelled to remember and ask!
True...... =)
this may
be your "dilbert-dead-possum" (explanation available upon request) project
but i find it fascinating.
And explanation is requested. =) I think I have the jist of where its
going, but would still like to hear it. =)

-CJ

do keep us posted!

For sure. =)
steve

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
Getting there. A great deal of the framework is done, I do have dynamic
event hooking completed which is really the core of it. Ironically I have
been documenting the whole thing too, which is a suprise for me... because
I
usually don't. But figured if I'm going to hand this out to anyone,
they gotta see what I'm thinking with it.

But yeah, its getting there, I wanted to write a few more modules to test it
before I let it out on the public. Or the private public that is =)
Working with a user security module right now, and this is the thing I'm
struggling with, not because its hard, but I don't know what would be

the best way.

I could embed it into the framework and make things much easier. But that just seems to defeat the purpose of a 100% scalable app (plus I have to

redo
some of my dynamic event handling... forget that...) So I'm trying a few things and see where it goes. I wanted to deliver the framework and a few samples of how it works before I put it out.

So hopefully soon. I keep getting backlogged with old VB6 at work, these things happen, so I've been off it for like 3 days. Blah.

The one thing I'm suprsed at is it is incredibly light weight and seems to have some enourmous potential from what I see. Now obviusly I want to

make
it more dynamic, but I think the most important thing is the visual event linker I built. Which should help out with development because it handles ALL event handling between plugins for you. And it's just implementing a single interface.

SoThanks for asking, that actually felt good that someone rememberd. =)

I'll keep you informed.

CJ
"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
how's that application going anyway cj?
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
> Armin,
>
> hate to disagree with you here, but...
>
> You can create a new delegate at runtime using the delegate class (it
gets
> tricky, but you can), and then you can bind events etc to the
delegate to
a
> target method. And if you were so inclined (even though it seems
like > overkill and no *real* use) you could
>
> 1) Load an assembly to grab an event out of...
> 2) Get the signiture of the event you want to hook (each event in

.NET > automatically creates a delegate class at runtime, you have to watch

your
> assembly in debug to see it, but if you iterate through getTypes()

you'll
> see that there is a delegate created for the event.
> 3) Use CodeDom to create a class or whatever.
> 4) compile into a DLL
> 5) reference the newly created assembly
> 6) grab the method, use the delegate creator to hook the event and

method.
> 7) Add Handler. =)
>
> Now this is saying you do everything dynamically (including the creation of
> a method). BUt you can simply hook to another method that matches the > signiture (depending on how strict you make it,you can check
basetypes as
> well to match sig.) And you can do this all dynamically at runtime.

=) >
> -CJ
>
> "Armin Zingler" <az*******@freenet.de> wrote in message
> news:eA**************@TK2MSFTNGP10.phx.gbl...
> > "Amit D.Shinde" <am*******@yahoo.com> schrieb
> > > I am adding a new picturebox control at runtime on the form
> > > How can i create click event handler for this control
> >
> > You can not create a handler at runtime, you have to write it at
> designtime.
> > You can _attach_ an event handler to an event: Addhandler
> myobject.theevent,
> > addressof handler
> >
> >
> > --
> > Armin
> >
>
>



Nov 20 '05 #11
fifth generation language. currently, we are considered 4gl. your app
basically interprets english and intuitively "knows" the intent of the
speaker/writer then takes appropriate action? the closer an language gets in
being written as one would write to another human being, the higher it's gl
rank. your app gets pretty high marks if it does what i think your boss
required it to do.

best of luck,

steve
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...

"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
are you kidding...you're working on something ver atl-ish AND
5gl-ish...kinda hard not to remember.
I'm familar with atl, what is 5gl?
what you've done w/ vb.net so far is
nearly impossible to do in vb6. i am compelled to remember and ask!


True...... =)
this may
be your "dilbert-dead-possum" (explanation available upon request) project
but i find it fascinating.


And explanation is requested. =) I think I have the jist of where its
going, but would still like to hear it. =)

-CJ

do keep us posted!


For sure. =)
steve

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
Getting there. A great deal of the framework is done, I do have dynamic event hooking completed which is really the core of it. Ironically I have been documenting the whole thing too, which is a suprise for me... because
I
usually don't. But figured if I'm going to hand this out to anyone,

they gotta see what I'm thinking with it.

But yeah, its getting there, I wanted to write a few more modules to test
it
before I let it out on the public. Or the private public that is =)
Working with a user security module right now, and this is the thing I'm struggling with, not because its hard, but I don't know what would be

the best way.

I could embed it into the framework and make things much easier. But that just seems to defeat the purpose of a 100% scalable app (plus I have to redo
some of my dynamic event handling... forget that...) So I'm trying a few things and see where it goes. I wanted to deliver the framework and a few samples of how it works before I put it out.

So hopefully soon. I keep getting backlogged with old VB6 at work, these things happen, so I've been off it for like 3 days. Blah.

The one thing I'm suprsed at is it is incredibly light weight and
seems to have some enourmous potential from what I see. Now obviusly I want to make
it more dynamic, but I think the most important thing is the visual event linker I built. Which should help out with development because it handles ALL event handling between plugins for you. And it's just
implementing a single interface.

SoThanks for asking, that actually felt good that someone rememberd.
=)
I'll keep you informed.

CJ
"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
> how's that application going anyway cj?
>
>
> "CJ Taylor" <no****@blowgoats.com> wrote in message
> news:vn************@corp.supernews.com...
> > Armin,
> >
> > hate to disagree with you here, but...
> >
> > You can create a new delegate at runtime using the delegate class (it gets
> > tricky, but you can), and then you can bind events etc to the delegate to
> a
> > target method. And if you were so inclined (even though it seems like > > overkill and no *real* use) you could
> >
> > 1) Load an assembly to grab an event out of...
> > 2) Get the signiture of the event you want to hook (each event in

.NET
> > automatically creates a delegate class at runtime, you have to watch your
> > assembly in debug to see it, but if you iterate through getTypes()
you'll
> > see that there is a delegate created for the event.
> > 3) Use CodeDom to create a class or whatever.
> > 4) compile into a DLL
> > 5) reference the newly created assembly
> > 6) grab the method, use the delegate creator to hook the event and
method.
> > 7) Add Handler. =)
> >
> > Now this is saying you do everything dynamically (including the

creation
> of
> > a method). BUt you can simply hook to another method that matches the > > signiture (depending on how strict you make it,you can check basetypes as
> > well to match sig.) And you can do this all dynamically at

runtime. =)
> >
> > -CJ
> >
> > "Armin Zingler" <az*******@freenet.de> wrote in message
> > news:eA**************@TK2MSFTNGP10.phx.gbl...
> > > "Amit D.Shinde" <am*******@yahoo.com> schrieb
> > > > I am adding a new picturebox control at runtime on the form
> > > > How can i create click event handler for this control
> > >
> > > You can not create a handler at runtime, you have to write it at
> > designtime.
> > > You can _attach_ an event handler to an event: Addhandler
> > myobject.theevent,
> > > addressof handler
> > >
> > >
> > > --
> > > Armin
> > >
> >
> >
>
>



Nov 20 '05 #12
sorry...dilbert describes some corporate projects as "dead-possum"
projects...those projects that no one knows what to do with and don't want
them anywhere near their desk. one day a man went to clean his pool and
noticed a dead possum in the bottom of it. he didn't know what to do with it
and feared that if he just threw it in the trash, animal control w/b
notified and he get busted for animal cruelty...even though it probably just
died from slipping in the pool while trying to get a drink but couldn't get
out. so he gets the idea to just pitch it over the fence into his neighbor's
yard...his neighbor actually had a pool too in which the possum landed. the
next day, he goes to clean his pool again and there, in the bottom, is the
possum. apparently, the neighbor went through the same thought process and
came to the same conclusion. needless to say, each morning that possum was
at the bottom of his pool even though he pitched it over the fence upon
fishing it out.

dead-possum projects are the messy ones that keep finding their way back to
you. hopefully, you do get to pass this one off in the maintenance
cycle...it helps that you've provided documentation.

;^ )
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...

"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
are you kidding...you're working on something ver atl-ish AND
5gl-ish...kinda hard not to remember.
I'm familar with atl, what is 5gl?
what you've done w/ vb.net so far is
nearly impossible to do in vb6. i am compelled to remember and ask!


True...... =)
this may
be your "dilbert-dead-possum" (explanation available upon request) project
but i find it fascinating.


And explanation is requested. =) I think I have the jist of where its
going, but would still like to hear it. =)

-CJ

do keep us posted!


For sure. =)
steve

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
Getting there. A great deal of the framework is done, I do have dynamic event hooking completed which is really the core of it. Ironically I have been documenting the whole thing too, which is a suprise for me... because
I
usually don't. But figured if I'm going to hand this out to anyone,

they gotta see what I'm thinking with it.

But yeah, its getting there, I wanted to write a few more modules to test
it
before I let it out on the public. Or the private public that is =)
Working with a user security module right now, and this is the thing I'm struggling with, not because its hard, but I don't know what would be

the best way.

I could embed it into the framework and make things much easier. But that just seems to defeat the purpose of a 100% scalable app (plus I have to redo
some of my dynamic event handling... forget that...) So I'm trying a few things and see where it goes. I wanted to deliver the framework and a few samples of how it works before I put it out.

So hopefully soon. I keep getting backlogged with old VB6 at work, these things happen, so I've been off it for like 3 days. Blah.

The one thing I'm suprsed at is it is incredibly light weight and
seems to have some enourmous potential from what I see. Now obviusly I want to make
it more dynamic, but I think the most important thing is the visual event linker I built. Which should help out with development because it handles ALL event handling between plugins for you. And it's just
implementing a single interface.

SoThanks for asking, that actually felt good that someone rememberd.
=)
I'll keep you informed.

CJ
"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
> how's that application going anyway cj?
>
>
> "CJ Taylor" <no****@blowgoats.com> wrote in message
> news:vn************@corp.supernews.com...
> > Armin,
> >
> > hate to disagree with you here, but...
> >
> > You can create a new delegate at runtime using the delegate class (it gets
> > tricky, but you can), and then you can bind events etc to the delegate to
> a
> > target method. And if you were so inclined (even though it seems like > > overkill and no *real* use) you could
> >
> > 1) Load an assembly to grab an event out of...
> > 2) Get the signiture of the event you want to hook (each event in

.NET
> > automatically creates a delegate class at runtime, you have to watch your
> > assembly in debug to see it, but if you iterate through getTypes()
you'll
> > see that there is a delegate created for the event.
> > 3) Use CodeDom to create a class or whatever.
> > 4) compile into a DLL
> > 5) reference the newly created assembly
> > 6) grab the method, use the delegate creator to hook the event and
method.
> > 7) Add Handler. =)
> >
> > Now this is saying you do everything dynamically (including the

creation
> of
> > a method). BUt you can simply hook to another method that matches the > > signiture (depending on how strict you make it,you can check basetypes as
> > well to match sig.) And you can do this all dynamically at

runtime. =)
> >
> > -CJ
> >
> > "Armin Zingler" <az*******@freenet.de> wrote in message
> > news:eA**************@TK2MSFTNGP10.phx.gbl...
> > > "Amit D.Shinde" <am*******@yahoo.com> schrieb
> > > > I am adding a new picturebox control at runtime on the form
> > > > How can i create click event handler for this control
> > >
> > > You can not create a handler at runtime, you have to write it at
> > designtime.
> > > You can _attach_ an event handler to an event: Addhandler
> > myobject.theevent,
> > > addressof handler
> > >
> > >
> > > --
> > > Armin
> > >
> >
> >
>
>



Nov 20 '05 #13
Ahhh! Ok, sorry brain fart and couldn't remember what you were talking
about. But yes, I am aware of generation levels and ther einterpretation.
But I do appreicate you explaining it again (and I'm sure many others do
to).

That is the goal of this. Even though its not necessarily a language (or
maybe it is with an intelligent interface, I'm not sure) but it does provide
a lot of common functionality that you don't have to program. I suppose you
could compare it to something like IBS (and inherited forms) with a lot more
functionality between modules. Also, I use interfacing to do the
communication instead of object inheritance because I understand why
something like IBS uses Object inheritance, but it isn't really useful in a
windows evironment at least for this. That is understanding stateless vs
stateful connections (including UI).

I just looked at a problem, understand that my boss can't code at the same
level as me, but knows how he wants things to work. And instead of
re-releasing packages all the time (which we all know has its expenses) I
just wanted to plug a module in, link it to what I want, and go. That way,
no module has to know anything about another, but can be directly affected
by it, without knowing this at the time the program was written. So modules
could constantly communicate with new modules regardless of versioning,
programming, etc. And that way, even users that "know" what they want could
build powerful applications that perform a multitude of functions in a
fraction of the time for development. Or for that matter, the need to know
how to develop at all.

So far its working, I just get weary when something is going my way. =) The
thing that scares me is the idea was relativly simple, implementation was
diffucult, but once I got the hang of it, we were cool. It was just
understanding all levels of how programs could communicate with eachother
(not with remoting) without actually knowing who/what they were talking to.
I suppose it was a reflection or philosophy on how OOP works.

But he tried it, understood it right away and saw it working (sure, I have
some bugs to work out, but nothing major) he just was like "Wow... that was
easy... So these two dll's that dont know eachother exist, are talking to
eachother and influencing eachothers functionality through the framework?"

"Yep."

"cool."

-CJ

"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
fifth generation language. currently, we are considered 4gl. your app
basically interprets english and intuitively "knows" the intent of the
speaker/writer then takes appropriate action? the closer an language gets in being written as one would write to another human being, the higher it's gl rank. your app gets pretty high marks if it does what i think your boss
required it to do.

best of luck,

steve
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...

"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
are you kidding...you're working on something ver atl-ish AND
5gl-ish...kinda hard not to remember.


I'm familar with atl, what is 5gl?
what you've done w/ vb.net so far is
nearly impossible to do in vb6. i am compelled to remember and ask!


True...... =)
this may
be your "dilbert-dead-possum" (explanation available upon request) project but i find it fascinating.


And explanation is requested. =) I think I have the jist of where its
going, but would still like to hear it. =)

-CJ

do keep us posted!


For sure. =)
steve

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
> Getting there. A great deal of the framework is done, I do have dynamic > event hooking completed which is really the core of it. Ironically I
have
> been documenting the whole thing too, which is a suprise for me...

because
I
> usually don't. But figured if I'm going to hand this out to anyone,

they
> gotta see what I'm thinking with it.
>
> But yeah, its getting there, I wanted to write a few more modules to

test
it
> before I let it out on the public. Or the private public that is =)
> Working with a user security module right now, and this is the thing I'm > struggling with, not because its hard, but I don't know what would
be
the
> best way.
>
> I could embed it into the framework and make things much easier.
But that
> just seems to defeat the purpose of a 100% scalable app (plus I have to redo
> some of my dynamic event handling... forget that...) So I'm trying
a few
> things and see where it goes. I wanted to deliver the framework and
a few
> samples of how it works before I put it out.
>
> So hopefully soon. I keep getting backlogged with old VB6 at work,

these
> things happen, so I've been off it for like 3 days. Blah.
>
> The one thing I'm suprsed at is it is incredibly light weight and seems
to
> have some enourmous potential from what I see. Now obviusly I want

to make
> it more dynamic, but I think the most important thing is the visual

event
> linker I built. Which should help out with development because it

handles
> ALL event handling between plugins for you. And it's just

implementing
a
> single interface.
>
> SoThanks for asking, that actually felt good that someone rememberd.

=) >
> I'll keep you informed.
>
> CJ
> "steve" <as*@abc.com> wrote in message
> news:vn************@corp.supernews.com...
> > how's that application going anyway cj?
> >
> >
> > "CJ Taylor" <no****@blowgoats.com> wrote in message
> > news:vn************@corp.supernews.com...
> > > Armin,
> > >
> > > hate to disagree with you here, but...
> > >
> > > You can create a new delegate at runtime using the delegate class (it
> gets
> > > tricky, but you can), and then you can bind events etc to the

delegate
> to
> > a
> > > target method. And if you were so inclined (even though it
seems
like
> > > overkill and no *real* use) you could
> > >
> > > 1) Load an assembly to grab an event out of...
> > > 2) Get the signiture of the event you want to hook (each event
in .NET
> > > automatically creates a delegate class at runtime, you have to

watch > your
> > > assembly in debug to see it, but if you iterate through getTypes() > you'll
> > > see that there is a delegate created for the event.
> > > 3) Use CodeDom to create a class or whatever.
> > > 4) compile into a DLL
> > > 5) reference the newly created assembly
> > > 6) grab the method, use the delegate creator to hook the event and > method.
> > > 7) Add Handler. =)
> > >
> > > Now this is saying you do everything dynamically (including the
creation
> > of
> > > a method). BUt you can simply hook to another method that matches the
> > > signiture (depending on how strict you make it,you can check

basetypes
> as
> > > well to match sig.) And you can do this all dynamically at runtime. =)
> > >
> > > -CJ
> > >
> > > "Armin Zingler" <az*******@freenet.de> wrote in message
> > > news:eA**************@TK2MSFTNGP10.phx.gbl...
> > > > "Amit D.Shinde" <am*******@yahoo.com> schrieb
> > > > > I am adding a new picturebox control at runtime on the form
> > > > > How can i create click event handler for this control
> > > >
> > > > You can not create a handler at runtime, you have to write it

at > > > designtime.
> > > > You can _attach_ an event handler to an event: Addhandler
> > > myobject.theevent,
> > > > addressof handler
> > > >
> > > >
> > > > --
> > > > Armin
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #14

"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
sorry...dilbert describes some corporate projects as "dead-possum"
projects...those projects that no one knows what to do with and don't want
them anywhere near their desk. one day a man went to clean his pool and
noticed a dead possum in the bottom of it. he didn't know what to do with it and feared that if he just threw it in the trash, animal control w/b
notified and he get busted for animal cruelty...even though it probably just died from slipping in the pool while trying to get a drink but couldn't get out. so he gets the idea to just pitch it over the fence into his neighbor's yard...his neighbor actually had a pool too in which the possum landed. the next day, he goes to clean his pool again and there, in the bottom, is the
possum. apparently, the neighbor went through the same thought process and
came to the same conclusion. needless to say, each morning that possum was
at the bottom of his pool even though he pitched it over the fence upon
fishing it out.
Ahhh yes, I know what your talking about... I think dilbert works at
Caterpillar...

dead-possum projects are the messy ones that keep finding their way back to you. hopefully, you do get to pass this one off in the maintenance
cycle...it helps that you've provided documentation.

That was the goal of the documentation. So that a user / developer could
understand how to implement there own modules easily. And not in overused
techno-jargon either. That way, liek you said, in the maintenence cycle I
can pawn it off, and continue focusing on improvement rather than training.
Also, the other thing I was thinking of is I don't want to write these
modules. Sounds kooky huh? But to say that I could write every module for
every application that would provide a useful function is narcissitic and
wrong. =) I just think to the number of apps I've developed, the procedures
I've recreated that are similar but different enough, and just want a
starting point so that eventually, even applciations that were never
intended to be related, now easily could interact with eachother leading to
more productive business.

talk soon,
cj
;^ )
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...

"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
are you kidding...you're working on something ver atl-ish AND
5gl-ish...kinda hard not to remember.


I'm familar with atl, what is 5gl?
what you've done w/ vb.net so far is
nearly impossible to do in vb6. i am compelled to remember and ask!


True...... =)
this may
be your "dilbert-dead-possum" (explanation available upon request) project but i find it fascinating.


And explanation is requested. =) I think I have the jist of where its
going, but would still like to hear it. =)

-CJ

do keep us posted!


For sure. =)
steve

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
> Getting there. A great deal of the framework is done, I do have dynamic > event hooking completed which is really the core of it. Ironically I
have
> been documenting the whole thing too, which is a suprise for me...

because
I
> usually don't. But figured if I'm going to hand this out to anyone,

they
> gotta see what I'm thinking with it.
>
> But yeah, its getting there, I wanted to write a few more modules to

test
it
> before I let it out on the public. Or the private public that is =)
> Working with a user security module right now, and this is the thing I'm > struggling with, not because its hard, but I don't know what would
be
the
> best way.
>
> I could embed it into the framework and make things much easier.
But that
> just seems to defeat the purpose of a 100% scalable app (plus I have to redo
> some of my dynamic event handling... forget that...) So I'm trying
a few
> things and see where it goes. I wanted to deliver the framework and
a few
> samples of how it works before I put it out.
>
> So hopefully soon. I keep getting backlogged with old VB6 at work,

these
> things happen, so I've been off it for like 3 days. Blah.
>
> The one thing I'm suprsed at is it is incredibly light weight and seems
to
> have some enourmous potential from what I see. Now obviusly I want

to make
> it more dynamic, but I think the most important thing is the visual

event
> linker I built. Which should help out with development because it

handles
> ALL event handling between plugins for you. And it's just

implementing
a
> single interface.
>
> SoThanks for asking, that actually felt good that someone rememberd.

=) >
> I'll keep you informed.
>
> CJ
> "steve" <as*@abc.com> wrote in message
> news:vn************@corp.supernews.com...
> > how's that application going anyway cj?
> >
> >
> > "CJ Taylor" <no****@blowgoats.com> wrote in message
> > news:vn************@corp.supernews.com...
> > > Armin,
> > >
> > > hate to disagree with you here, but...
> > >
> > > You can create a new delegate at runtime using the delegate class (it
> gets
> > > tricky, but you can), and then you can bind events etc to the

delegate
> to
> > a
> > > target method. And if you were so inclined (even though it
seems
like
> > > overkill and no *real* use) you could
> > >
> > > 1) Load an assembly to grab an event out of...
> > > 2) Get the signiture of the event you want to hook (each event
in .NET
> > > automatically creates a delegate class at runtime, you have to

watch > your
> > > assembly in debug to see it, but if you iterate through getTypes() > you'll
> > > see that there is a delegate created for the event.
> > > 3) Use CodeDom to create a class or whatever.
> > > 4) compile into a DLL
> > > 5) reference the newly created assembly
> > > 6) grab the method, use the delegate creator to hook the event and > method.
> > > 7) Add Handler. =)
> > >
> > > Now this is saying you do everything dynamically (including the
creation
> > of
> > > a method). BUt you can simply hook to another method that matches the
> > > signiture (depending on how strict you make it,you can check

basetypes
> as
> > > well to match sig.) And you can do this all dynamically at runtime. =)
> > >
> > > -CJ
> > >
> > > "Armin Zingler" <az*******@freenet.de> wrote in message
> > > news:eA**************@TK2MSFTNGP10.phx.gbl...
> > > > "Amit D.Shinde" <am*******@yahoo.com> schrieb
> > > > > I am adding a new picturebox control at runtime on the form
> > > > > How can i create click event handler for this control
> > > >
> > > > You can not create a handler at runtime, you have to write it

at > > > designtime.
> > > > You can _attach_ an event handler to an event: Addhandler
> > > myobject.theevent,
> > > > addressof handler
> > > >
> > > >
> > > > --
> > > > Armin
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #15
But, to think that 1 23 year dude from Illinois could do this is a little
hard to believe as well. =)
"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
sorry...dilbert describes some corporate projects as "dead-possum"
projects...those projects that no one knows what to do with and don't want
them anywhere near their desk. one day a man went to clean his pool and
noticed a dead possum in the bottom of it. he didn't know what to do with it and feared that if he just threw it in the trash, animal control w/b
notified and he get busted for animal cruelty...even though it probably just died from slipping in the pool while trying to get a drink but couldn't get out. so he gets the idea to just pitch it over the fence into his neighbor's yard...his neighbor actually had a pool too in which the possum landed. the next day, he goes to clean his pool again and there, in the bottom, is the
possum. apparently, the neighbor went through the same thought process and
came to the same conclusion. needless to say, each morning that possum was
at the bottom of his pool even though he pitched it over the fence upon
fishing it out.

dead-possum projects are the messy ones that keep finding their way back to you. hopefully, you do get to pass this one off in the maintenance
cycle...it helps that you've provided documentation.

;^ )
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...

"steve" <as*@abc.com> wrote in message
news:vn************@corp.supernews.com...
are you kidding...you're working on something ver atl-ish AND
5gl-ish...kinda hard not to remember.


I'm familar with atl, what is 5gl?
what you've done w/ vb.net so far is
nearly impossible to do in vb6. i am compelled to remember and ask!


True...... =)
this may
be your "dilbert-dead-possum" (explanation available upon request) project but i find it fascinating.


And explanation is requested. =) I think I have the jist of where its
going, but would still like to hear it. =)

-CJ

do keep us posted!


For sure. =)
steve

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
> Getting there. A great deal of the framework is done, I do have dynamic > event hooking completed which is really the core of it. Ironically I
have
> been documenting the whole thing too, which is a suprise for me...

because
I
> usually don't. But figured if I'm going to hand this out to anyone,

they
> gotta see what I'm thinking with it.
>
> But yeah, its getting there, I wanted to write a few more modules to

test
it
> before I let it out on the public. Or the private public that is =)
> Working with a user security module right now, and this is the thing I'm > struggling with, not because its hard, but I don't know what would
be
the
> best way.
>
> I could embed it into the framework and make things much easier.
But that
> just seems to defeat the purpose of a 100% scalable app (plus I have to redo
> some of my dynamic event handling... forget that...) So I'm trying
a few
> things and see where it goes. I wanted to deliver the framework and
a few
> samples of how it works before I put it out.
>
> So hopefully soon. I keep getting backlogged with old VB6 at work,

these
> things happen, so I've been off it for like 3 days. Blah.
>
> The one thing I'm suprsed at is it is incredibly light weight and seems
to
> have some enourmous potential from what I see. Now obviusly I want

to make
> it more dynamic, but I think the most important thing is the visual

event
> linker I built. Which should help out with development because it

handles
> ALL event handling between plugins for you. And it's just

implementing
a
> single interface.
>
> SoThanks for asking, that actually felt good that someone rememberd.

=) >
> I'll keep you informed.
>
> CJ
> "steve" <as*@abc.com> wrote in message
> news:vn************@corp.supernews.com...
> > how's that application going anyway cj?
> >
> >
> > "CJ Taylor" <no****@blowgoats.com> wrote in message
> > news:vn************@corp.supernews.com...
> > > Armin,
> > >
> > > hate to disagree with you here, but...
> > >
> > > You can create a new delegate at runtime using the delegate class (it
> gets
> > > tricky, but you can), and then you can bind events etc to the

delegate
> to
> > a
> > > target method. And if you were so inclined (even though it
seems
like
> > > overkill and no *real* use) you could
> > >
> > > 1) Load an assembly to grab an event out of...
> > > 2) Get the signiture of the event you want to hook (each event
in .NET
> > > automatically creates a delegate class at runtime, you have to

watch > your
> > > assembly in debug to see it, but if you iterate through getTypes() > you'll
> > > see that there is a delegate created for the event.
> > > 3) Use CodeDom to create a class or whatever.
> > > 4) compile into a DLL
> > > 5) reference the newly created assembly
> > > 6) grab the method, use the delegate creator to hook the event and > method.
> > > 7) Add Handler. =)
> > >
> > > Now this is saying you do everything dynamically (including the
creation
> > of
> > > a method). BUt you can simply hook to another method that matches the
> > > signiture (depending on how strict you make it,you can check

basetypes
> as
> > > well to match sig.) And you can do this all dynamically at runtime. =)
> > >
> > > -CJ
> > >
> > > "Armin Zingler" <az*******@freenet.de> wrote in message
> > > news:eA**************@TK2MSFTNGP10.phx.gbl...
> > > > "Amit D.Shinde" <am*******@yahoo.com> schrieb
> > > > > I am adding a new picturebox control at runtime on the form
> > > > > How can i create click event handler for this control
> > > >
> > > > You can not create a handler at runtime, you have to write it

at > > > designtime.
> > > > You can _attach_ an event handler to an event: Addhandler
> > > myobject.theevent,
> > > > addressof handler
> > > >
> > > >
> > > > --
> > > > Armin
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: MS Newsgroups | last post by:
Hi, I have a scenario where I am dynamically adding a control from code when a controls event is fired. The problem I have is that when the newly created control is clicked, the click event does...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
3
by: RSB | last post by:
Hi Every one Having tuff time creating web controls Dynamically. All i am trying to do is read a table and generate a list of ASP TEXT Box. So how do i create this Control dynamically and where...
2
by: Wee Bubba | last post by:
my user control (usercontrol1.ascx) is added dynamically into a placeholder on page_load. within usercontrol1.ascx there is a button. When a user presses this button I want the page to reload with...
0
by: Homam | last post by:
To wire a Click event handler to a dynamically-added control (e.g. LinkButton), you need to do so during the Load event of the parent (e.g. a PlaceHolder). The problem is, the Click event...
3
by: bill | last post by:
I am using VS2005 to build a web form dynamically. I'm using AddHandler to connect a custom event handler to the TextChanged event of dynamically added textbox controls. Data entered in the...
1
by: kaczmar2 | last post by:
I have an ASP.NET page where controls are created dynamically, and I have an issue where one event handler creates another set of controls, and then adds event handlers to those controls. The...
4
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi, I have built a custom control button which inherits from WebControl and implements IPostBackEventHandler. The control also declares an event Click and provides a method OnClick which invokes...
5
by: =?Utf-8?B?TWFyYyBXb29sZnNvbg==?= | last post by:
Hi, I have a strange issue occurring with LinkButtons that are dynamically added to each (data) row of my DataGrid on that grid's ItemDataBound event. Each LinkButton is assigned its own event...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.