タイトル | : 文字列から文字を取り出したい |
記事No | : 8775 |
投稿日 | : 2009/03/04(Wed) 06:25 |
投稿者 | : れお♪ |
かっこよく文字を取り出したい!! 例えば A="EZ安心アクセスサービスに加入しよう" とある場合に文字列の?番目の1文字を取り出したいです。 コードを作りましたが、かっこよくないのでお願いします。 'VisualBasic2008(無料版) 'EZ安心プログラム Option Strict On Public Class Form1 Private moji_suu As Integer = 18 Private moji(moji_suu - 1) As String Private ezlabel() As System.Windows.Forms.Label Private x, y As Integer Private colorR_suu As Integer = 5 Private colorR(colorR_suu - 1) As Color Private colorR_count As Integer = 0 Private label_count As Integer = 1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load moji(0) = "E" : moji(1) = "Z" : moji(2) = "安" : moji(3) = "心" : moji(4) = "ア" : moji(5) = "ク" moji(6) = "セ" : moji(7) = "ス" : moji(8) = "サ" : moji(9) = "-" : moji(10) = "ビ" : moji(11) = "ス" moji(12) = "に" : moji(13) = "加" : moji(14) = "入" : moji(15) = "し" : moji(16) = "よ" : moji(17) = "う" Me.BackColor = Color.Gray Me.ezlabel = New System.Windows.Forms.Label(17) {} Me.SuspendLayout() Dim pp As Integer For pp = 0 To Me.ezlabel.Length - 1 Me.ezlabel(pp) = New System.Windows.Forms.Label Me.ezlabel(pp).Text = moji(pp) Me.ezlabel(pp).Size = New Size(20, 20) Me.ezlabel(pp).Font = New Font("MS UI Gothic", 13) Me.ezlabel(pp).Visible = False ezlavel_ichi(pp * -20) Me.ezlabel(pp).Location = New Point(100 + x, 100 + y) Next Me.Controls.AddRange(Me.ezlabel) Me.ResumeLayout(False) '_____________________color colorR(0) = Color.Aqua : colorR(1) = Color.BurlyWood : colorR(2) = Color.GreenYellow colorR(3) = Color.Blue : colorR(4) = Color.Pink Timer1.Interval = 200 End Sub Private Sub ezlavel_ichi(ByVal kakudo As Integer) x = CInt(70 * Math.Cos(kakudo * Math.PI / 180)) y = CInt(70 * Math.Sin(kakudo * Math.PI / 180)) End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim cc As Integer For cc = 0 To 17 Me.ezlabel(cc).Visible = False Next Me.ezlabel(label_count).Visible = True If label_count = 0 Then For cc = 0 To 17 Me.ezlabel(cc).Visible = True Next End If Me.ezlabel(label_count).ForeColor = colorR(colorR_count) colorR_count += 1 If colorR_count = 5 Then colorR_count = 0 label_count += 1 If label_count = 18 Then label_count = 0 End Sub End Class
|