Why does the Winform's InitializeComponent sub call a private Sub

  • Thread starter Thread starter Venkat Venkataramanan
  • Start date Start date
V

Venkat Venkataramanan

Hello:

I have a winform that has a private subroutine defined as:

Private Sub ApplyFilter()

This sub refers to objects that get instantiated in the
winform's new method.

However, when I run the application, the New Method has a
InitializeComponent() method that steps into the private
subroutine I have, creating an error condition.

Is this the normal course of events? If not, what am I
doing wrong?

Thanks.

Venkat
 
Venkat Venkataramanan said:
I have a winform that has a private subroutine defined as:

Private Sub ApplyFilter()

This sub refers to objects that get instantiated in the
winform's new method.

However, when I run the application, the New Method has a
InitializeComponent() method that steps into the private
subroutine I have, creating an error condition.

Is this the normal course of events? If not, what am I
doing wrong?

Are you sure that InitializeComponent calls your sub? You can set a
breakpoint in your sub and have a look at the callstack to find out what
causes the call.
 
Hello,

Venkat Venkataramanan said:
I have a winform that has a private subroutine defined as:

Private Sub ApplyFilter()

This sub refers to objects that get instantiated in the
winform's new method.

However, when I run the application, the New Method has a
InitializeComponent() method that steps into the private
subroutine I have, creating an error condition.

Where do you call your method 'ApplyFilter'?
 
Armin:

I found out where I am shooting myself in my foot!

The subroutine also gets called in the CheckStateChanged
event on a check box. Of course this gets triggered by
the Initialize Component subroutine.

I changed it so it gets called on the clicked event
instead.

Thanks for your insight.

Venkat
 
Back
Top