Connecting Tech Pros Worldwide Help | Site Map

Convert subroutine

  #1  
Old September 25th, 2007, 04:05 PM
Galil
Guest
 
Posts: n/a
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

  #2  
Old September 25th, 2007, 04:15 PM
Jim Mack
Guest
 
Posts: n/a

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
  #3  
Old September 25th, 2007, 05:45 PM
=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=
Guest
 
Posts: n/a

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 Threads
Thread Thread Starter Forum Replies Last Post
Call a Subroutine SenileOwl answers 0 April 17th, 2008 10:13 PM
Subroutine in a loop problem ashashi87 answers 4 December 30th, 2007 08:01 PM
subroutine johnperl answers 1 September 27th, 2007 07:10 PM
.net 2005 convert from VB to c++ Galil answers 2 September 25th, 2007 11:45 PM