SciLor's Open Source Forums

Also visit my Website!
It is currently Sun Nov 19, 2017 11:43 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Feb 15, 2011 12:53 am 
I have make part of the convertion from VB6 to VB2008 SDK WM5 and WM6
I have a problem converting "Left ()" and "Right ()" Strings


Form1:


Text1
Text2
List1
Command1

Code:

Public Class Form1


Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
Me.Close()
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub



Private Sub Command1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click
Dim BLeft As String = Microsoft.VisualBasic.Left(Text2.Text, 1)
Dim BRight As String = Microsoft.VisualBasic.Right(Text2.Text, Len(Text2.Text) - 1)

'MessageBox.Show("D-Link Router", MessageBoxButtons.OK)

Text2.Text = ""
List1.Items.Clear()

Text2.Text = UCase(Text1.Text)

For i = 0 To Len(Text2.Text) - 1
List1.Items.Add(BLeft)
Text2.Text = BRight
Next i

Text2.Text = List1.Items(11) & List1.Items(0) & List1.Items(10) & List1.Items(1) & List1.Items(9) & _
List1.Items(2) & List1.Items(8) & List1.Items(3) & List1.Items(7) & List1.Items(4) & List1.Items(6) & _
List1.Items(5) & List1.Items(1) & List1.Items(6) & List1.Items(8) & List1.Items(9) & List1.Items(11) & _
List1.Items(2) & List1.Items(4) & List1.Items(10)

List1.Items.Clear()

For i = 0 To Len(Text2.Text) - 1
List1.Items.Add(BLeft)
Text2.Text = BRight
Next i

For i = 0 To List1.Items.Count
Select Case List1.Items.Add(i)
Case "1"
Text2.Text = Text2.Text = "r"
Case "2"
Text2.Text = Text2.Text = "q"
Case "3"
Text2.Text = Text2.Text & "a"
Case "4"
Text2.Text = Text2.Text & "H"
Case "5"
Text2.Text = Text2.Text & "N"
Case "6"
Text2.Text = Text2.Text & "p"
Case "7"
Text2.Text = Text2.Text & "D"
Case "8"
Text2.Text = Text2.Text & "S"
Case "9"
Text2.Text = Text2.Text & "Y"
Case "0"
Text2.Text = Text2.Text & "X"
Case "A"
Text2.Text = Text2.Text & "w"
Case "B"
Text2.Text = Text2.Text & "8"
Case "C"
Text2.Text = Text2.Text & "6"
Case "D"
Text2.Text = Text2.Text & "2"
Case "E"
Text2.Text = Text2.Text & "1"
Case "F2"
Text2.Text = Text2.Text & "5"
End Select
Next i

End Sub
End Class



MSN Contact: paulobarca_7@hotmail.com


Top
  
 
 
Online
The Adswinger

Joined: Wed Jan 13, 2010 11:56 pm
Posts: Too many!
Donated: Ad Posts


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
template->_php_include(): File ./counter/foruminclude.php does not exist or is empty Powered by phpBB® Forum Software © phpBB Group