Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27409

VS 2010 Passing additional parameter to Event Handling Sub

$
0
0
INFO: nDiamonds is Numeric Up Down control


PHP Code:

   Private Sub Form1_Load(ByVal sender As System.ObjectByVal e As System.EventArgsHandles MyBase.Load
        nDiamonds_ValueChanged
(sendere)
    
End Sub

    
Private Sub item1_CheckedChanged(ByVal sender As System.ObjectByVal e As System.EventArgsHandles item1.CheckedChanged
        
If item1.Checked True Then
            nDiamonds
.Value nDiamonds.Value 1
        
Else
            
nDiamonds.Value nDiamonds.Value 1
        End 
If
        
nDiamonds_ValueChanged(sendere)
    
End Sub

    
Private Sub nDiamonds_ValueChanged(ByVal sender As System.ObjectByVal e As System.EventArgsHandles nDiamonds.ValueChanged
        
If nDiamonds.Value 0 Then
            item1
.Enabled True
            item2
.Enabled True
            item3
.Enabled True
            item4
.Enabled True
        
Else
            
item1.Enabled False
            item2
.Enabled False
            item3
.Enabled False
            item4
.Enabled False
        End 
If

        
' Wants to add this line:
        ' 
o.Enabled True
        
' where o is the object parameter that I want to add to this Sub '

    
End Sub 

From the Sub 'item1_CheckedChanged', I want to pass the object 'item1' (Check Box) to the arguments of the Sub 'nDiamonds_ValueChanged' but if I add additional parameter to the Sub I get an error regarding unmatched signature.

How can I do that ?

Viewing all articles
Browse latest Browse all 27409

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>