Finding/calling events of a control

  • Thread starter Thread starter Tosch
  • Start date Start date
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
 
What are you trying to accomplish? Are you trying to add controls
dynamically?

Chris
 
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
 
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
 
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
 
Back
Top