By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

Problem with event messaging between 2 classes

P: n/a
Hi,

I've got troubles with event messaging between 2 classes.
In a WinForm, a DataGrid has a ComboBox. I need to use the SelectedIndexChanged of the cbo to perform some DB updates.
ComboBox is done by a component that exposes 2 classes: DataGridComboBox that inherits from ComboBox and
DataGridComboBoxColumnStyle that inherits from DataGridColumnStyle.

In DataGridComboBox I declared an event: Public Event ppSelectedIndexChanged()
This event is raised by DataGridComboBox_ SelectedIndexChanged

In the client code(the WinForm code) an instance of DataGridComboBox is declared WithEvents: Private WithEvents oDataGridComboBox As DataGridComboBox
At this time, if I select the object DataGridComboBox, I can see the event ppSelectedIndexChanged in the list.

Then I write a sub to handle the event:
Public Sub oDataGridComboBox_ppSelectedIndexChanged() Handles oDataGridComboBox.ppSelectedIndexChanged

When the code run, the SelectedIndexChanged event is fired and fires ppSelectedIndexChanged, but the
oDataGridComboBox_ppSelectedIndexChanged event handler is not executed.

I also tried to use the AddHandler, AddressOf mechanism, but with few success either!

Can someone help be solve this trick?

TIA,

Philippe
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.