Convert subroutine

G

Galil

I have a subroutine I need to convert from vb.net 2005 to visual C++
( .net 2005)
The function only allows specific characters to be typed into a
textbox. the backspace and 0 -9.

Private Sub textbox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Select Case Asc(e.KeyChar) <-- Is this function available in C+
+?
Case 8, 48 To 57
e.Handled = False
Case Else
e.Handled = True
End Select
End Sub

Could someone convert this into C++?
Thank you
 
J

Jim Mack

Please trim comp.lang.basic... from the reply list. It's a VB6 group,
not a .NET group.
 
G

Guest

I have a subroutine I need to convert from vb.net 2005 to visual C++
( .net 2005)
The function only allows specific characters to be typed into a
textbox. the backspace and 0 -9.

Private Sub textbox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Select Case Asc(e.KeyChar) <-- Is this function available in C+
+?
Case 8, 48 To 57
e.Handled = False
Case Else
e.Handled = True
End Select
End Sub

To pure C++? Probably not since it is a method used together with .Net
Windows Forms classes. For more help ask in a group for the .Net
framework, such as microsoft.public.dotnet.framework.windowsforms.
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top