Public class form1 inherits system.windows.Forms.form
#Region "Windows Form Designer Generated Code"
Public Sub new () mybase.new ()
'This call is required for the Windows Form Designer. InitializeComponent ()
'Add any initialization after INITIALIZECOMPONENT ()
End Sub
'Form rewriting Dispose to clean up the list of components. Protected overloads overrides sub dispose (byval disposing as boolean) ing disponation kiln (Components Is Nothing) Then components.dispose () end if endiffs) End sub
'Windows Form Designer Supply Private Components as System.comPonentModel.icontainer
'Note: The following procedure is necessary to use the Windows Form Designer to modify this process using the Windows Form Designer. 'Don't modify it using the code editor. Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
#End region
Private sub textbox1_textchanged (Byval E AS System.EventArgs) Handles TextBox1.TextChangedend Sub
Private Sub TextBox1_KeyDown (ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown If e.KeyCode = Keys.Escape Then TextBox2.Text = UnicodeToGB (TextBox1.Text) End If If e.KeyCode = Keys.f1 Then TextBox1.text = "" TextBox2.text = "" End if End Sub
Private Function UnicoDetogb (Byval Strunicode As String) AS String Dim Gbcode As String Dim I, J AS Integer Dim C () AS String 'Temporary Variable Redim C (Strunicode.length / 4)' 2 bytes One Chinese
For J = 0 to strunicode.Length / 4 - 1 DIM D () As char = Strunicode.ToChararray (j * 4, 4) c (j) = "& H" & ctype (d, string) c (j) = chrw (VAL (c (j))) GBCODE = C (j) 'Returns the last result back Return GBCode End Function
Private Sub Form1_Load (Byval E AS System.Object, Byval E AS System.Eventargs) Handles MyBase.Load
End Subend Class