Преобразователь текста на MS Visual Basic.NET 9 (Framework 3.5 WPF)

  • Дата статьи:
  • Автор:

Небольшая программа для преобразования текста в числовое значение определенного типа.

Описание формы: Window1.xaml

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/present..."
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Text converter" Height="492" Width="600">
    
        
            
            
            
            
            
            
            
            
            
        

        
            
            
            
            
            
            
            
            
            
        

        
        

        
          

        
        

        
        Hec
        Dec
        Oct
        Bin
    


Исходный код:Window1.xaml.vb

Class Window1
    Dim pr As Integer = 16

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
        Dim sm As Integer
        Dim nm As Integer
        Dim txt As String
        Dim tm As String
        TextBox2.Text = ""
        txt = TextBox1.Text
        ProgressBar1.Maximum = txt.Length - 1
        For sm = 0 To txt.Length - 1
            tm = txt(sm)
            For nm = 0 To 255
                If tm = Chr(nm) Then TextBox2.Text = " " Convert.ToString(nm, pr)
            Next nm
            ProgressBar1.Value = sm
        Next sm
    End Sub

    Private Sub RadioButton1_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles RadioButton1.Checked
        pr = 16
    End Sub

    Private Sub RadioButton2_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles RadioButton2.Checked
        pr = 10
    End Sub

    Private Sub RadioButton3_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles RadioButton3.Checked
        pr = 8
    End Sub

    Private Sub RadioButton4_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles RadioButton4.Checked
        pr = 2
    End Sub
End Class

Вот так это все выглядит:

Преобразователь текста на MS Visual Basic.NET 9 (Framework 3.5 WPF)




-->