Connecting Tech Pros Worldwide Help | Site Map

Convert subroutine

Galil
Guest
 
Posts: n/a
#1: Sep 25 '07
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

Jim Mack
Guest
 
Posts: n/a
#2: Sep 25 '07

re: Convert subroutine


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


Galil wrote:
Quote:
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
=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=
Guest
 
Posts: n/a
#3: Sep 25 '07

re: Convert subroutine


On 2007-09-25 17:04, Galil wrote:
Quote:
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.

--
Erik Wikström
Closed Thread


Similar C / C++ bytes