Assigning Events

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I am creating a Windows Forms VB7 project. The Main Form is particularly complicated and I am currently using a form-level integer variable called 'FormMode' to control certain aspects of execution. What I would like to do is somehow make this variable into a class and then assign an event to its changing value. I would then be able to cut down on some of the code I have in the form by just using the change event handler I created. Could someone give me some guidance on this or point me to a good example please? Thanks
JT
 
* "=?Utf-8?B?SlQ=?= said:
I am creating a Windows Forms VB7 project. The Main Form is particularly complicated and I am currently using a form-level integer variable called 'FormMode' to control certain aspects of execution. What I would like to do is somehow make this variable into a class and then assign an event to its changing value. I would then be able to cut down on some of the code I have in the form by just using the change event handler I created. Could someone give me some guidance on this or point me to a good example please? Thanks.

\\\
Public Event VariableValueChanged(ByVal NewValue As Integer)
..
..
..
Private Sub ChangeValue(ByVal NewValue As Integer)
m_Variable = NewValue
RaiseEvent VariableValueChanged(NewValue)
End Sub
///
 

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

Back
Top