New to both VB6 and VB.NET but trying to learn both...
i created a class module (which is working) in VB6...
can't seem to figure out how to get same functionality in VB.NET....any help would be great...this is what i have in VB6....all applicable controls are named cmd00 to cmd09...this is fairly simple and just have buttons for #'s 0-9...that when clicked just concatenate to the end of a text box (txtCurScore)...any help ".NETing" this would be appreciated...
In Standard Module
VB Code:
Dim Buttons01() As New cls01 Sub OpenMainForm() Dim ctl As Control Dim cnt01 As Integer For Each ctl In Form1.Controls If TypeOf ctl Is CommandButton Then If Left(ctl.Name, 4) = "cmd0" Then cnt01 = cnt01 + 1 ReDim Preserve Buttons01(1 To cnt01) Set Buttons01(cnt01).Buttons01Class = ctl End If End If Next ctl vForm.Show vForm.Refresh End Sub
In Standard Module
VB Code:
Sub Group01() Form1.txtCurScore.Text = Form1.txtCurScore.Text & Val(Right(Form1.ActiveControl.Name, 1)) End Sub
In Class Module
VB Code:
Public WithEvents Buttons01Class As CommandButton Private Sub Buttons01Class_click() Group01 End Sub




Reply With Quote