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

[RESOLVED] Problem with a Combo Loop in VB 2010 Express

$
0
0
I have a Windows form with 50 ComboBox controls.

Is there any way to put the code below in a loop so I don't have to have 50 such Subs?


Problem Code:
  1. Private Sub ComboLine1_Keypress(sender As System.Object, e As System.EventArgs) Handles ComboLine1.KeyPress
  2.         Call CheckKeyPressEntries(e)
  3.     End Sub
  4.  
  5.     Private Sub ComboLine2_KeyPress(sender As System.Object, e As System.EventArgs) Handles ComboLine2.KeyPress
  6.         Call CheckKeyPressEntries(e)
  7.     End Sub
  8.  
  9.     Private Sub ComboLine3_KeyPress(sender As System.Object, e As System.EventArgs) Handles ComboLine3.KeyPress
  10.         Call CheckKeyPressEntries(e)
  11.     End Sub
  12.  
  13.     Private Sub ComboLine4_KeyPress(sender As System.Object, e As System.EventArgs) Handles ComboLine4.KeyPress
  14.         Call CheckKeyPressEntries(e)
  15.     End Sub

Viewing all articles
Browse latest Browse all 27329

Trending Articles



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