Finding/calling events of a control

T

Tosch

Is there a way to find out which events are attached to a control (say
'validating' event for a textbox) and call the event?

Tosch
 
C

Chris, Master of All Things Insignificant

What are you trying to accomplish? Are you trying to add controls
dynamically?

Chris
 
C

Cor Ligthert

Tosch,

When you have instanced controls in your programs withevents (or draged them
on your form)

Than you can see them in the code part, when you select them in the
dropdownbox left above in the dropdownbox on the right. This for VB2002/2003
in VB2005 it will be as in C#.

I hope this helps?

Cor
 
T

Tosch

No, I'm having a number of forms with any number of controls on them.
Which controls are on the form is defined in a seperate program.

With some functions in my program I have to fill some of the controls
with values and want to call the validate event because some validate
events may cause other controls to be calculated.

Tosch
 
C

Chris, Master of All Things Insignificant

I don't know of a way to iterate through a controls current events. Not
that there isn't a way.

Is this "separate program" that defines which controls are on the form your
code? What about adding a method to the controls to handle the accepting of
the values so that it can validate itself? Something akin to this:

'*****Poor Written Pseudo Code
SomeControl as TextBox
Public Property FillValue(..)
.Text = Value
SomeControl_Validate()
End Sub

Chris
 

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

Top