473,395 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

to update a class for a text box

hai,,

I am new to vb.net.. I want to do something in which i should pass array of values into textbox..

that is.. I have a picturebox and textbox.. Using draw string function i get input for the textbox.. but what i actually need is to call a class which contains array of bitmap values and i have to call to my text box..

My code is like

Expand|Select|Wrap|Line Numbers
  1. 'this is for main window
  2. Public Class Form1
  3.     Dim graph As Graphics
  4.     Dim drawbitmap As Bitmap
  5.     Dim brush As New Drawing.SolidBrush(Color.Black)
  6.  
  7.     Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  8.         drawbitmap = New Bitmap(144, 16)
  9.         graph = Graphics.FromImage(drawbitmap)
  10.         PictureBox1.Image = drawbitmap
  11.         graph.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
  12.         graph.DrawString(TextBox1.Text, TextBox1.Font, brush, PictureBox1.Location)
  13.  
  14.     End Sub
  15.  
  16. End Class
  17.  
  18. 'my class code is
  19.  
  20. 'This class is used for mapping characters into BitArrays.
  21. 'Nothing too complicated going on here.
  22. 'Characters are based on a 5X7 Matrix Display.
  23.  
  24. Public Class MatrixCharacterMapper
  25.  
  26.     Private _maps() As BitArray
  27.  
  28.     Public Sub New()
  29.  
  30.     End Sub
  31.  
  32.     Public Sub New(ByVal text As String)
  33.         GenerateCharacterMaps(text)
  34.     End Sub
  35.  
  36.     Default Public Property CharacterMap(ByVal index As Integer) As BitArray
  37.  
  38.         Get
  39.  
  40.             If index < 0 Or index > _maps.Length - 1 Then
  41.                 Return Nothing
  42.             End If
  43.  
  44.             Return _maps(index)
  45.  
  46.         End Get
  47.  
  48.         Set(ByVal map As BitArray)
  49.  
  50.             If index < 0 Or index > _maps.Length - 1 Then
  51.                 Return
  52.             End If
  53.  
  54.             _maps(index) = map
  55.  
  56.         End Set
  57.  
  58.     End Property
  59.  
  60.     Public ReadOnly Property CharacterMaps() As BitArray()
  61.  
  62.         Get
  63.  
  64.             If _maps Is Nothing Then
  65.                 Return Nothing
  66.             End If
  67.  
  68.             Return _maps.Clone()
  69.  
  70.         End Get
  71.  
  72.     End Property
  73.  
  74.     'we generate our bit arrays, feel free to modify these or create your own
  75.     Public Sub GenerateCharacterMaps(ByVal text As String)
  76.  
  77.         If text.Length = 0 Then
  78.             Return
  79.         End If
  80.  
  81.         ReDim _maps(text.Length - 1)
  82.  
  83.         For i As Integer = 0 To text.Length - 1
  84.  
  85.             'build this char into its relative bit array
  86.             _maps(i) = BuildCharacterMap(text.Chars(i))
  87.  
  88.         Next
  89.  
  90.     End Sub
  91.  
  92.     'this is just cake
  93.     '35 bits/char 5X7 matrix display
  94.     Private Function BuildCharacterMap(ByVal character As Char) As BitArray
  95.  
  96.         Select Case character
  97.  
  98.             'Lower Case Characters
  99.             Case Is = "a"
  100.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  101.                                              0, 0, 0, 0, 0, _
  102.                                              0, 1, 1, 1, 0, _
  103.                                              0, 0, 0, 0, 1, _
  104.                                              0, 1, 1, 1, 1, _
  105.                                              1, 0, 0, 0, 1, _
  106.                                              0, 1, 1, 1, 1})
  107.  
  108.             Case Is = "b"
  109.                 Return BitsOn(New Integer() {1, 0, 0, 0, 0, _
  110.                                              1, 0, 0, 0, 0, _
  111.                                              1, 0, 1, 1, 0, _
  112.                                              1, 1, 0, 0, 1, _
  113.                                              1, 0, 0, 0, 1, _
  114.                                              1, 0, 0, 0, 1, _
  115.                                              1, 1, 1, 1, 0})
  116.  
  117.             Case Is = "c"
  118.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  119.                                              0, 0, 0, 0, 0, _
  120.                                              0, 1, 1, 1, 0, _
  121.                                              1, 0, 0, 0, 0, _
  122.                                              1, 0, 0, 0, 0, _
  123.                                              1, 0, 0, 0, 1, _
  124.                                              0, 1, 1, 1, 0})
  125.  
  126.             Case Is = "d"
  127.                 Return BitsOn(New Integer() {0, 0, 0, 0, 1, _
  128.                                              0, 0, 0, 0, 1, _
  129.                                              0, 1, 1, 0, 1, _
  130.                                              1, 0, 0, 1, 1, _
  131.                                              1, 0, 0, 0, 1, _
  132.                                              1, 0, 0, 0, 1, _
  133.                                              0, 1, 1, 1, 1})
  134.  
  135.             Case Is = "e"
  136.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  137.                                              0, 0, 0, 0, 0, _
  138.                                              0, 1, 1, 1, 0, _
  139.                                              1, 0, 0, 0, 1, _
  140.                                              1, 1, 1, 1, 1, _
  141.                                              1, 0, 0, 0, 0, _
  142.                                              0, 1, 1, 1, 0})
  143.  
  144.             Case Is = "f"
  145.                 Return BitsOn(New Integer() {0, 0, 1, 1, 0, _
  146.                                              0, 1, 0, 0, 1, _
  147.                                              0, 1, 0, 0, 0, _
  148.                                              1, 1, 1, 1, 0, _
  149.                                              0, 1, 0, 0, 0, _
  150.                                              0, 1, 0, 0, 0, _
  151.                                              0, 1, 0, 0, 0})
  152.  
  153.             Case Is = "g"
  154.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  155.                                              0, 1, 1, 1, 1, _
  156.                                              1, 0, 0, 0, 1, _
  157.                                              1, 0, 0, 0, 1, _
  158.                                              0, 1, 1, 1, 1, _
  159.                                              0, 0, 0, 0, 1, _
  160.                                              0, 1, 1, 1, 0})
  161.  
  162.             Case Is = "h"
  163.                 Return BitsOn(New Integer() {1, 0, 0, 0, 0, _
  164.                                              1, 0, 0, 0, 0, _
  165.                                              1, 0, 1, 1, 0, _
  166.                                              1, 1, 0, 0, 1, _
  167.                                              1, 0, 0, 0, 1, _
  168.                                              1, 0, 0, 0, 1, _
  169.                                              1, 0, 0, 0, 1})
  170.  
  171.             Case Is = "i"
  172.                 Return BitsOn(New Integer() {0, 0, 1, 0, 0, _
  173.                                              0, 0, 0, 0, 0, _
  174.                                              0, 1, 1, 0, 0, _
  175.                                              0, 0, 1, 0, 0, _
  176.                                              0, 0, 1, 0, 0, _
  177.                                              0, 0, 1, 0, 0, _
  178.                                              0, 1, 1, 1, 0})
  179.  
  180.             Case Is = "j"
  181.                 Return BitsOn(New Integer() {0, 0, 0, 1, 0, _
  182.                                              0, 0, 0, 0, 0, _
  183.                                              0, 0, 1, 1, 0, _
  184.                                              0, 0, 0, 1, 0, _
  185.                                              0, 0, 0, 1, 0, _
  186.                                              1, 0, 0, 1, 0, _
  187.                                              0, 1, 1, 0, 0})
  188.  
  189.             Case Is = "k"
  190.                 Return BitsOn(New Integer() {1, 0, 0, 0, 0, _
  191.                                              1, 0, 0, 0, 0, _
  192.                                              1, 0, 0, 1, 0, _
  193.                                              1, 0, 1, 0, 0, _
  194.                                              1, 1, 0, 0, 0, _
  195.                                              1, 0, 1, 0, 0, _
  196.                                              1, 0, 0, 1, 0})
  197.  
  198.             Case Is = "l"
  199.                 Return BitsOn(New Integer() {0, 1, 1, 0, 0, _
  200.                                              0, 0, 1, 0, 0, _
  201.                                              0, 0, 1, 0, 0, _
  202.                                              0, 0, 1, 0, 0, _
  203.                                              0, 0, 1, 0, 0, _
  204.                                              0, 0, 1, 0, 0, _
  205.                                              0, 1, 1, 1, 0})
  206.  
  207.             Case Is = "m"
  208.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  209.                                              0, 0, 0, 0, 0, _
  210.                                              1, 1, 0, 1, 0, _
  211.                                              1, 0, 1, 0, 1, _
  212.                                              1, 0, 1, 0, 1, _
  213.                                              1, 0, 1, 0, 1, _
  214.                                              1, 0, 1, 0, 1})
  215.  
  216.             Case Is = "n"
  217.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  218.                                              0, 0, 0, 0, 0, _
  219.                                              1, 0, 1, 1, 0, _
  220.                                              1, 1, 0, 0, 1, _
  221.                                              1, 0, 0, 0, 1, _
  222.                                              1, 0, 0, 0, 1, _
  223.                                              1, 0, 0, 0, 1})
  224.  
  225.             Case Is = "o"
  226.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  227.                                              0, 0, 0, 0, 0, _
  228.                                              0, 1, 1, 1, 0, _
  229.                                              1, 0, 0, 0, 1, _
  230.                                              1, 0, 0, 0, 1, _
  231.                                              1, 0, 0, 0, 1, _
  232.                                              0, 1, 1, 1, 0})
  233.  
  234.             Case Is = "p"
  235.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  236.                                              0, 0, 0, 0, 0, _
  237.                                              1, 1, 1, 1, 0, _
  238.                                              1, 0, 0, 0, 1, _
  239.                                              1, 1, 1, 1, 0, _
  240.                                              1, 0, 0, 0, 0, _
  241.                                              1, 0, 0, 0, 0})
  242.  
  243.             Case Is = "q"
  244.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  245.                                              0, 0, 0, 0, 0, _
  246.                                              0, 1, 1, 0, 1, _
  247.                                              1, 0, 0, 1, 1, _
  248.                                              0, 1, 1, 1, 1, _
  249.                                              0, 0, 0, 0, 1, _
  250.                                              0, 0, 0, 0, 1})
  251.  
  252.             Case Is = "r"
  253.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  254.                                              0, 0, 0, 0, 0, _
  255.                                              1, 0, 1, 1, 0, _
  256.                                              1, 1, 0, 0, 1, _
  257.                                              1, 0, 0, 0, 0, _
  258.                                              1, 0, 0, 0, 0, _
  259.                                              1, 0, 0, 0, 0})
  260.  
  261.             Case Is = "s"
  262.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  263.                                              0, 0, 0, 0, 0, _
  264.                                              0, 1, 1, 1, 0, _
  265.                                              1, 0, 0, 0, 0, _
  266.                                              0, 1, 1, 1, 0, _
  267.                                              0, 0, 0, 0, 1, _
  268.                                              1, 1, 1, 1, 0})
  269.  
  270.             Case Is = "t"
  271.                 Return BitsOn(New Integer() {0, 1, 0, 0, 0, _
  272.                                              0, 1, 0, 0, 0, _
  273.                                              1, 1, 1, 0, 0, _
  274.                                              0, 1, 0, 0, 0, _
  275.                                              0, 1, 0, 0, 0, _
  276.                                              0, 1, 0, 0, 1, _
  277.                                              0, 0, 1, 1, 0})
  278.  
  279.             Case Is = "u"
  280.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  281.                                              0, 0, 0, 0, 0, _
  282.                                              1, 0, 0, 0, 1, _
  283.                                              1, 0, 0, 0, 1, _
  284.                                              1, 0, 0, 0, 1, _
  285.                                              1, 0, 0, 1, 1, _
  286.                                              0, 1, 1, 0, 1})
  287.  
  288.             Case Is = "v"
  289.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  290.                                              0, 0, 0, 0, 0, _
  291.                                              1, 0, 0, 0, 1, _
  292.                                              1, 0, 0, 0, 1, _
  293.                                              1, 0, 0, 0, 1, _
  294.                                              0, 1, 0, 1, 0, _
  295.                                              0, 0, 1, 0, 0})
  296.  
  297.             Case Is = "w"
  298.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  299.                                              0, 0, 0, 0, 0, _
  300.                                              1, 0, 0, 0, 1, _
  301.                                              1, 0, 0, 0, 1, _
  302.                                              1, 0, 1, 0, 1, _
  303.                                              1, 0, 1, 0, 1, _
  304.                                              0, 1, 0, 1, 0})
  305.  
  306.             Case Is = "x"
  307.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  308.                                              0, 0, 0, 0, 0, _
  309.                                              1, 0, 0, 0, 1, _
  310.                                              0, 1, 0, 1, 0, _
  311.                                              0, 0, 1, 0, 0, _
  312.                                              0, 1, 0, 1, 0, _
  313.                                              1, 0, 0, 0, 1})
  314.  
  315.             Case Is = "y"
  316.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  317.                                              0, 0, 0, 0, 0, _
  318.                                              1, 0, 0, 0, 1, _
  319.                                              1, 0, 0, 0, 1, _
  320.                                              0, 1, 1, 1, 1, _
  321.                                              0, 0, 0, 0, 1, _
  322.                                              0, 1, 1, 1, 0})
  323.  
  324.             Case Is = "z"
  325.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  326.                                              0, 0, 0, 0, 0, _
  327.                                              1, 1, 1, 1, 1, _
  328.                                              0, 0, 0, 1, 0, _
  329.                                              0, 0, 1, 0, 0, _
  330.                                              0, 1, 0, 0, 0, _
  331.                                              1, 1, 1, 1, 1})
  332.  
  333.  
  334.                 'Upper Case Characters
  335.             Case Is = "A"
  336.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  337.                                              1, 0, 0, 0, 1, _
  338.                                              1, 0, 0, 0, 1, _
  339.                                              1, 0, 0, 0, 1, _
  340.                                              1, 1, 1, 1, 1, _
  341.                                              1, 0, 0, 0, 1, _
  342.                                              1, 0, 0, 0, 1})
  343.  
  344.             Case Is = "B"
  345.                 Return BitsOn(New Integer() {1, 1, 1, 1, 0, _
  346.                                              1, 0, 0, 0, 1, _
  347.                                              1, 0, 0, 0, 1, _
  348.                                              1, 1, 1, 1, 0, _
  349.                                              1, 0, 0, 0, 1, _
  350.                                              1, 0, 0, 0, 1, _
  351.                                              1, 1, 1, 1, 0})
  352.  
  353.             Case Is = "C"
  354.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  355.                                              1, 0, 0, 0, 1, _
  356.                                              1, 0, 0, 0, 0, _
  357.                                              1, 0, 0, 0, 0, _
  358.                                              1, 0, 0, 0, 0, _
  359.                                              1, 0, 0, 0, 1, _
  360.                                              0, 1, 1, 1, 0})
  361.  
  362.             Case Is = "D"
  363.                 Return BitsOn(New Integer() {1, 1, 1, 0, 0, _
  364.                                              1, 0, 0, 1, 0, _
  365.                                              1, 0, 0, 0, 1, _
  366.                                              1, 0, 0, 0, 1, _
  367.                                              1, 0, 0, 0, 1, _
  368.                                              1, 0, 0, 1, 0, _
  369.                                              1, 1, 1, 0, 0})
  370.  
  371.             Case Is = "E"
  372.                 Return BitsOn(New Integer() {1, 1, 1, 1, 1, _
  373.                                              1, 0, 0, 0, 0, _
  374.                                              1, 0, 0, 0, 0, _
  375.                                              1, 1, 1, 1, 0, _
  376.                                              1, 0, 0, 0, 0, _
  377.                                              1, 0, 0, 0, 0, _
  378.                                              1, 1, 1, 1, 1})
  379.  
  380.             Case Is = "F"
  381.                 Return BitsOn(New Integer() {1, 1, 1, 1, 1, _
  382.                                              1, 0, 0, 0, 0, _
  383.                                              1, 0, 0, 0, 0, _
  384.                                              1, 1, 1, 1, 0, _
  385.                                              1, 0, 0, 0, 0, _
  386.                                              1, 0, 0, 0, 0, _
  387.                                              1, 0, 0, 0, 0})
  388.  
  389.             Case Is = "G"
  390.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  391.                                              1, 0, 0, 0, 1, _
  392.                                              1, 0, 0, 0, 0, _
  393.                                              1, 0, 1, 1, 1, _
  394.                                              1, 0, 0, 0, 1, _
  395.                                              1, 0, 0, 0, 1, _
  396.                                              0, 1, 1, 1, 1})
  397.  
  398.             Case Is = "H"
  399.                 Return BitsOn(New Integer() {1, 0, 0, 0, 1, _
  400.                                              1, 0, 0, 0, 1, _
  401.                                              1, 0, 0, 0, 1, _
  402.                                              1, 1, 1, 1, 1, _
  403.                                              1, 0, 0, 0, 1, _
  404.                                              1, 0, 0, 0, 1, _
  405.                                              1, 0, 0, 0, 1})
  406.  
  407.             Case Is = "I"
  408.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  409.                                              0, 0, 1, 0, 0, _
  410.                                              0, 0, 1, 0, 0, _
  411.                                              0, 0, 1, 0, 0, _
  412.                                              0, 0, 1, 0, 0, _
  413.                                              0, 0, 1, 0, 0, _
  414.                                              0, 1, 1, 1, 0})
  415.  
  416.             Case Is = "J"
  417.                 Return BitsOn(New Integer() {0, 0, 1, 1, 1, _
  418.                                              0, 0, 0, 1, 0, _
  419.                                              0, 0, 0, 1, 0, _
  420.                                              0, 0, 0, 1, 0, _
  421.                                              0, 0, 0, 1, 0, _
  422.                                              1, 0, 0, 1, 0, _
  423.                                              0, 1, 1, 0, 0})
  424.  
  425.             Case Is = "K"
  426.                 Return BitsOn(New Integer() {1, 0, 0, 0, 1, _
  427.                                              1, 0, 0, 1, 0, _
  428.                                              1, 0, 1, 0, 0, _
  429.                                              1, 1, 0, 0, 0, _
  430.                                              1, 0, 1, 0, 0, _
  431.                                              1, 0, 0, 1, 0, _
  432.                                              1, 0, 0, 0, 1})
  433.  
  434.             Case Is = "L"
  435.                 Return BitsOn(New Integer() {1, 0, 0, 0, 0, _
  436.                                              1, 0, 0, 0, 0, _
  437.                                              1, 0, 0, 0, 0, _
  438.                                              1, 0, 0, 0, 0, _
  439.                                              1, 0, 0, 0, 0, _
  440.                                              1, 0, 0, 0, 0, _
  441.                                              1, 1, 1, 1, 1})
  442.  
  443.             Case Is = "M"
  444.                 Return BitsOn(New Integer() {1, 0, 0, 0, 1, _
  445.                                              1, 1, 0, 1, 1, _
  446.                                              1, 0, 1, 0, 1, _
  447.                                              1, 0, 1, 0, 1, _
  448.                                              1, 0, 0, 0, 1, _
  449.                                              1, 0, 0, 0, 1, _
  450.                                              1, 0, 0, 0, 1})
  451.  
  452.             Case Is = "N"
  453.                 Return BitsOn(New Integer() {1, 0, 0, 0, 1, _
  454.                                              1, 0, 0, 0, 1, _
  455.                                              1, 1, 0, 0, 1, _
  456.                                              1, 0, 1, 0, 1, _
  457.                                              1, 0, 0, 1, 1, _
  458.                                              1, 0, 0, 0, 1, _
  459.                                              1, 0, 0, 0, 1})
  460.  
  461.             Case Is = "O"
  462.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  463.                                              1, 0, 0, 0, 1, _
  464.                                              1, 0, 0, 0, 1, _
  465.                                              1, 0, 0, 0, 1, _
  466.                                              1, 0, 0, 0, 1, _
  467.                                              1, 0, 0, 0, 1, _
  468.                                              0, 1, 1, 1, 0})
  469.  
  470.             Case Is = "P"
  471.                 Return BitsOn(New Integer() {1, 1, 1, 1, 0, _
  472.                                              1, 0, 0, 0, 1, _
  473.                                              1, 0, 0, 0, 1, _
  474.                                              1, 1, 1, 1, 0, _
  475.                                              1, 0, 0, 0, 0, _
  476.                                              1, 0, 0, 0, 0, _
  477.                                              1, 0, 0, 0, 0})
  478.  
  479.             Case Is = "Q"
  480.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  481.                                              1, 0, 0, 0, 1, _
  482.                                              1, 0, 0, 0, 1, _
  483.                                              1, 0, 0, 0, 1, _
  484.                                              1, 0, 1, 0, 1, _
  485.                                              1, 0, 0, 1, 0, _
  486.                                              0, 1, 1, 0, 1})
  487.  
  488.             Case Is = "R"
  489.                 Return BitsOn(New Integer() {1, 1, 1, 1, 0, _
  490.                                              1, 0, 0, 0, 1, _
  491.                                              1, 0, 0, 0, 1, _
  492.                                              1, 1, 1, 1, 0, _
  493.                                              1, 0, 1, 0, 0, _
  494.                                              1, 0, 0, 1, 0, _
  495.                                              1, 0, 0, 0, 1})
  496.  
  497.             Case Is = "S"
  498.                 Return BitsOn(New Integer() {0, 1, 1, 1, 1, _
  499.                                              1, 0, 0, 0, 0, _
  500.                                              1, 0, 0, 0, 0, _
  501.                                              0, 1, 1, 1, 0, _
  502.                                              0, 0, 0, 0, 1, _
  503.                                              0, 0, 0, 0, 1, _
  504.                                              1, 1, 1, 1, 0})
  505.  
  506.             Case Is = "T"
  507.                 Return BitsOn(New Integer() {1, 1, 1, 1, 1, _
  508.                                              0, 0, 1, 0, 0, _
  509.                                              0, 0, 1, 0, 0, _
  510.                                              0, 0, 1, 0, 0, _
  511.                                              0, 0, 1, 0, 0, _
  512.                                              0, 0, 1, 0, 0, _
  513.                                              0, 0, 1, 0, 0})
  514.  
  515.             Case Is = "U"
  516.                 Return BitsOn(New Integer() {1, 0, 0, 0, 1, _
  517.                                              1, 0, 0, 0, 1, _
  518.                                              1, 0, 0, 0, 1, _
  519.                                              1, 0, 0, 0, 1, _
  520.                                              1, 0, 0, 0, 1, _
  521.                                              1, 0, 0, 0, 1, _
  522.                                              0, 1, 1, 1, 0})
  523.  
  524.             Case Is = "V"
  525.                 Return BitsOn(New Integer() {1, 0, 0, 0, 1, _
  526.                                              1, 0, 0, 0, 1, _
  527.                                              1, 0, 0, 0, 1, _
  528.                                              1, 0, 0, 0, 1, _
  529.                                              1, 0, 0, 0, 1, _
  530.                                              0, 1, 0, 1, 0, _
  531.                                              0, 0, 1, 0, 0})
  532.  
  533.             Case Is = "W"
  534.                 Return BitsOn(New Integer() {1, 0, 0, 0, 1, _
  535.                                              1, 0, 0, 0, 1, _
  536.                                              1, 0, 0, 0, 1, _
  537.                                              1, 0, 1, 0, 1, _
  538.                                              1, 0, 1, 0, 1, _
  539.                                              1, 0, 1, 0, 1, _
  540.                                              0, 1, 0, 1, 0})
  541.  
  542.             Case Is = "X"
  543.                 Return BitsOn(New Integer() {1, 0, 0, 0, 1, _
  544.                                              1, 0, 0, 0, 1, _
  545.                                              0, 1, 0, 1, 0, _
  546.                                              0, 0, 1, 0, 0, _
  547.                                              0, 1, 0, 1, 0, _
  548.                                              1, 0, 0, 0, 1, _
  549.                                              1, 0, 0, 0, 1})
  550.  
  551.             Case Is = "Y"
  552.                 Return BitsOn(New Integer() {1, 0, 0, 0, 1, _
  553.                                              1, 0, 0, 0, 1, _
  554.                                              1, 0, 0, 0, 1, _
  555.                                              0, 1, 1, 1, 0, _
  556.                                              0, 0, 1, 0, 0, _
  557.                                              0, 0, 1, 0, 0, _
  558.                                              0, 0, 1, 0, 0})
  559.  
  560.             Case Is = "Z"
  561.                 Return BitsOn(New Integer() {1, 1, 1, 1, 1, _
  562.                                              0, 0, 0, 0, 1, _
  563.                                              0, 0, 0, 1, 0, _
  564.                                              0, 0, 1, 0, 0, _
  565.                                              0, 1, 0, 0, 0, _
  566.                                              1, 0, 0, 0, 0, _
  567.                                              1, 1, 1, 1, 1})
  568.  
  569.  
  570.                 'Numbers
  571.             Case Is = "0"
  572.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  573.                                              1, 0, 0, 0, 1, _
  574.                                              1, 0, 0, 1, 1, _
  575.                                              1, 0, 1, 0, 1, _
  576.                                              1, 1, 0, 0, 1, _
  577.                                              1, 0, 0, 0, 1, _
  578.                                              0, 1, 1, 1, 0})
  579.  
  580.             Case Is = "1"
  581.                 Return BitsOn(New Integer() {0, 0, 1, 0, 0, _
  582.                                              0, 1, 1, 0, 0, _
  583.                                              0, 0, 1, 0, 0, _
  584.                                              0, 0, 1, 0, 0, _
  585.                                              0, 0, 1, 0, 0, _
  586.                                              0, 0, 1, 0, 0, _
  587.                                              0, 1, 1, 1, 0})
  588.  
  589.             Case Is = "2"
  590.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  591.                                              1, 0, 0, 0, 1, _
  592.                                              0, 0, 0, 0, 1, _
  593.                                              0, 0, 0, 1, 0, _
  594.                                              0, 0, 1, 0, 0, _
  595.                                              0, 1, 0, 0, 0, _
  596.                                              1, 1, 1, 1, 1})
  597.  
  598.             Case Is = "3"
  599.                 Return BitsOn(New Integer() {1, 1, 1, 1, 1, _
  600.                                              0, 0, 0, 1, 0, _
  601.                                              0, 0, 1, 0, 0, _
  602.                                              0, 0, 0, 1, 0, _
  603.                                              0, 0, 0, 0, 1, _
  604.                                              1, 0, 0, 0, 1, _
  605.                                              0, 1, 1, 1, 0})
  606.  
  607.             Case Is = "4"
  608.                 Return BitsOn(New Integer() {0, 0, 0, 1, 0, _
  609.                                              0, 0, 1, 1, 0, _
  610.                                              0, 1, 0, 1, 0, _
  611.                                              1, 1, 1, 1, 1, _
  612.                                              0, 0, 0, 1, 0, _
  613.                                              0, 0, 0, 1, 0, _
  614.                                              0, 0, 0, 1, 0})
  615.  
  616.             Case Is = "5"
  617.                 Return BitsOn(New Integer() {1, 1, 1, 1, 1, _
  618.                                              1, 0, 0, 0, 0, _
  619.                                              1, 1, 1, 1, 1, _
  620.                                              0, 0, 0, 0, 1, _
  621.                                              0, 0, 0, 0, 1, _
  622.                                              1, 0, 0, 0, 1, _
  623.                                              0, 1, 1, 1, 0})
  624.  
  625.             Case Is = "6"
  626.                 Return BitsOn(New Integer() {0, 0, 1, 1, 0, _
  627.                                              0, 1, 0, 0, 0, _
  628.                                              1, 0, 0, 0, 0, _
  629.                                              1, 1, 1, 1, 0, _
  630.                                              1, 0, 0, 0, 1, _
  631.                                              1, 0, 0, 0, 1, _
  632.                                              0, 1, 1, 1, 0})
  633.  
  634.             Case Is = "7"
  635.                 Return BitsOn(New Integer() {1, 1, 1, 1, 1, _
  636.                                              0, 0, 0, 0, 1, _
  637.                                              0, 0, 0, 1, 0, _
  638.                                              0, 0, 1, 0, 0, _
  639.                                              0, 1, 0, 0, 0, _
  640.                                              0, 1, 0, 0, 0, _
  641.                                              0, 1, 0, 0, 0})
  642.  
  643.             Case Is = "8"
  644.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  645.                                              1, 0, 0, 0, 1, _
  646.                                              1, 0, 0, 0, 1, _
  647.                                              0, 1, 1, 1, 0, _
  648.                                              1, 0, 0, 0, 1, _
  649.                                              1, 0, 0, 0, 1, _
  650.                                              0, 1, 1, 1, 0})
  651.  
  652.             Case Is = "9"
  653.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  654.                                              1, 0, 0, 0, 1, _
  655.                                              1, 0, 0, 0, 1, _
  656.                                              0, 1, 1, 1, 1, _
  657.                                              0, 0, 0, 0, 1, _
  658.                                              0, 0, 0, 1, 0, _
  659.                                              0, 1, 1, 0, 0})
  660.  
  661.  
  662.                 'Shift + 1-9
  663.             Case Is = "!"
  664.                 Return BitsOn(New Integer() {0, 0, 1, 0, 0, _
  665.                                              0, 0, 1, 0, 0, _
  666.                                              0, 0, 1, 0, 0, _
  667.                                              0, 0, 1, 0, 0, _
  668.                                              0, 0, 0, 0, 0, _
  669.                                              0, 0, 0, 0, 0, _
  670.                                              0, 0, 1, 0, 0})
  671.  
  672.             Case Is = "@"
  673.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  674.                                              1, 0, 0, 0, 1, _
  675.                                              0, 0, 0, 0, 1, _
  676.                                              0, 1, 1, 0, 1, _
  677.                                              1, 0, 1, 0, 1, _
  678.                                              1, 0, 1, 0, 1, _
  679.                                              0, 1, 1, 1, 0})
  680.  
  681.             Case Is = "#"
  682.                 Return BitsOn(New Integer() {0, 1, 0, 1, 0, _
  683.                                              0, 1, 0, 1, 0, _
  684.                                              1, 1, 1, 1, 1, _
  685.                                              0, 1, 0, 1, 0, _
  686.                                              1, 1, 1, 1, 1, _
  687.                                              0, 1, 0, 1, 0, _
  688.                                              0, 1, 0, 1, 0})
  689.             Case Is = "$"
  690.                 Return BitsOn(New Integer() {0, 0, 1, 0, 0, _
  691.                                              0, 1, 1, 1, 1, _
  692.                                              1, 0, 1, 0, 0, _
  693.                                              0, 1, 1, 1, 0, _
  694.                                              0, 0, 1, 0, 1, _
  695.                                              1, 1, 1, 1, 0, _
  696.                                              0, 0, 1, 0, 0})
  697.  
  698.             Case Is = "%"
  699.                 Return BitsOn(New Integer() {1, 1, 0, 0, 0, _
  700.                                              1, 1, 0, 0, 1, _
  701.                                              0, 0, 0, 1, 0, _
  702.                                              0, 0, 1, 0, 0, _
  703.                                              0, 1, 0, 0, 0, _
  704.                                              1, 0, 0, 1, 1, _
  705.                                              0, 0, 0, 1, 1})
  706.  
  707.             Case Is = "^"
  708.                 Return BitsOn(New Integer() {0, 0, 1, 0, 0, _
  709.                                              0, 1, 0, 1, 0, _
  710.                                              1, 0, 0, 0, 1, _
  711.                                              0, 0, 0, 0, 0, _
  712.                                              0, 0, 0, 0, 0, _
  713.                                              0, 0, 0, 0, 0, _
  714.                                              0, 0, 0, 0, 0})
  715.  
  716.             Case Is = "&"
  717.                 Return BitsOn(New Integer() {0, 1, 1, 0, 0, _
  718.                                              1, 0, 0, 1, 0, _
  719.                                              1, 0, 1, 0, 0, _
  720.                                              0, 1, 0, 0, 0, _
  721.                                              1, 0, 1, 0, 1, _
  722.                                              1, 0, 0, 1, 0, _
  723.                                              0, 1, 1, 0, 1})
  724.  
  725.             Case Is = "*"
  726.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  727.                                              0, 0, 1, 0, 0, _
  728.                                              1, 0, 1, 0, 1, _
  729.                                              0, 1, 1, 1, 0, _
  730.                                              1, 0, 1, 0, 1, _
  731.                                              0, 0, 1, 0, 0, _
  732.                                              0, 0, 0, 0, 0})
  733.  
  734.             Case Is = "("
  735.                 Return BitsOn(New Integer() {0, 0, 0, 1, 0, _
  736.                                              0, 0, 1, 0, 0, _
  737.                                              0, 1, 0, 0, 0, _
  738.                                              0, 1, 0, 0, 0, _
  739.                                              0, 1, 0, 0, 0, _
  740.                                              0, 0, 1, 0, 0, _
  741.                                              0, 0, 0, 1, 0})
  742.  
  743.             Case Is = ")"
  744.                 Return BitsOn(New Integer() {0, 1, 0, 0, 0, _
  745.                                              0, 0, 1, 0, 0, _
  746.                                              0, 0, 0, 1, 0, _
  747.                                              0, 0, 0, 1, 0, _
  748.                                              0, 0, 0, 1, 0, _
  749.                                              0, 0, 1, 0, 0, _
  750.                                              0, 1, 0, 0, 0})
  751.  
  752.  
  753.                 'Misc
  754.             Case Is = " "
  755.                 Return New BitArray(35, False)
  756.  
  757.             Case Is = Chr(34)
  758.                 Return BitsOn(New Integer() {0, 1, 0, 1, 0, _
  759.                                              0, 1, 0, 1, 0, _
  760.                                              0, 1, 0, 1, 0, _
  761.                                              0, 0, 0, 0, 0, _
  762.                                              0, 0, 0, 0, 0, _
  763.                                              0, 0, 0, 0, 0, _
  764.                                              0, 0, 0, 0, 0})
  765.  
  766.             Case Is = "'"
  767.                 Return BitsOn(New Integer() {0, 0, 1, 1, 0, _
  768.                                              0, 0, 0, 1, 0, _
  769.                                              0, 0, 1, 0, 0, _
  770.                                              0, 0, 0, 0, 0, _
  771.                                              0, 0, 0, 0, 0, _
  772.                                              0, 0, 0, 0, 0, _
  773.                                              0, 0, 0, 0, 0})
  774.  
  775.  
  776.             Case Is = ","
  777.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  778.                                              0, 0, 0, 0, 0, _
  779.                                              0, 0, 0, 0, 0, _
  780.                                              0, 0, 0, 0, 0, _
  781.                                              0, 0, 1, 1, 0, _
  782.                                              0, 0, 0, 1, 0, _
  783.                                              0, 0, 1, 0, 0})
  784.  
  785.             Case Is = "-"
  786.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  787.                                              0, 0, 0, 0, 0, _
  788.                                              0, 0, 0, 0, 0, _
  789.                                              1, 1, 1, 1, 1, _
  790.                                              0, 0, 0, 0, 0, _
  791.                                              0, 0, 0, 0, 0, _
  792.                                              0, 0, 0, 0, 0})
  793.  
  794.             Case Is = "_"
  795.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  796.                                              0, 0, 0, 0, 0, _
  797.                                              0, 0, 0, 0, 0, _
  798.                                              0, 0, 0, 0, 0, _
  799.                                              0, 0, 0, 0, 0, _
  800.                                              0, 0, 0, 0, 0, _
  801.                                              1, 1, 1, 1, 1})
  802.  
  803.             Case Is = "."
  804.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  805.                                              0, 0, 0, 0, 0, _
  806.                                              0, 0, 0, 0, 0, _
  807.                                              0, 0, 0, 0, 0, _
  808.                                              0, 0, 0, 0, 0, _
  809.                                              0, 1, 1, 0, 0, _
  810.                                              0, 1, 1, 0, 0})
  811.  
  812.             Case Is = "/"
  813.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  814.                                              0, 0, 0, 0, 1, _
  815.                                              0, 0, 0, 1, 0, _
  816.                                              0, 0, 1, 0, 0, _
  817.                                              0, 1, 0, 0, 0, _
  818.                                              1, 0, 0, 0, 0, _
  819.                                              0, 0, 0, 0, 0})
  820.  
  821.             Case Is = "\"
  822.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  823.                                              1, 0, 0, 0, 0, _
  824.                                              0, 1, 0, 0, 0, _
  825.                                              0, 0, 1, 0, 0, _
  826.                                              0, 0, 0, 1, 0, _
  827.                                              0, 0, 0, 0, 1, _
  828.                                              0, 0, 0, 0, 0})
  829.  
  830.             Case Is = "="
  831.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  832.                                              0, 0, 0, 0, 0, _
  833.                                              1, 1, 1, 1, 1, _
  834.                                              0, 0, 0, 0, 0, _
  835.                                              1, 1, 1, 1, 1, _
  836.                                              0, 0, 0, 0, 0, _
  837.                                              0, 0, 0, 0, 0})
  838.  
  839.             Case Is = "+"
  840.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  841.                                              0, 0, 1, 0, 0, _
  842.                                              0, 0, 1, 0, 0, _
  843.                                              1, 1, 1, 1, 1, _
  844.                                              0, 0, 1, 0, 0, _
  845.                                              0, 0, 1, 0, 0, _
  846.                                              0, 0, 0, 0, 0})
  847.  
  848.             Case Is = ":"
  849.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  850.                                              0, 1, 1, 0, 0, _
  851.                                              0, 1, 1, 0, 0, _
  852.                                              0, 0, 0, 0, 0, _
  853.                                              0, 1, 1, 0, 0, _
  854.                                              0, 1, 1, 0, 0, _
  855.                                              0, 0, 0, 0, 0})
  856.  
  857.             Case Is = ";"
  858.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  859.                                              0, 1, 1, 0, 0, _
  860.                                              0, 1, 1, 0, 0, _
  861.                                              0, 0, 0, 0, 0, _
  862.                                              0, 1, 1, 0, 0, _
  863.                                              0, 0, 1, 0, 0, _
  864.                                              0, 1, 0, 0, 0})
  865.  
  866.  
  867.             Case Is = "<"
  868.                 Return BitsOn(New Integer() {0, 0, 0, 1, 0, _
  869.                                              0, 0, 1, 0, 0, _
  870.                                              0, 1, 0, 0, 0, _
  871.                                              1, 0, 0, 0, 0, _
  872.                                              0, 1, 0, 0, 0, _
  873.                                              0, 0, 1, 0, 0, _
  874.                                              0, 0, 0, 1, 0})
  875.  
  876.             Case Is = ">"
  877.                 Return BitsOn(New Integer() {0, 1, 0, 0, 0, _
  878.                                              0, 0, 1, 0, 0, _
  879.                                              0, 0, 0, 1, 0, _
  880.                                              0, 0, 0, 0, 1, _
  881.                                              0, 0, 0, 1, 0, _
  882.                                              0, 0, 1, 0, 0, _
  883.                                              0, 1, 0, 0, 0})
  884.  
  885.             Case Is = "?"
  886.                 Return BitsOn(New Integer() {0, 1, 1, 1, 0, _
  887.                                              1, 0, 0, 0, 1, _
  888.                                              0, 0, 0, 0, 1, _
  889.                                              0, 0, 0, 1, 0, _
  890.                                              0, 0, 1, 0, 0, _
  891.                                              0, 0, 0, 0, 0, _
  892.                                              0, 0, 1, 0, 0})
  893.  
  894.             Case Is = "["
  895.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  896.                                              0, 1, 1, 1, 0, _
  897.                                              0, 1, 0, 0, 0, _
  898.                                              0, 1, 0, 0, 0, _
  899.                                              0, 1, 0, 0, 0, _
  900.                                              0, 1, 0, 0, 0, _
  901.                                              0, 1, 1, 1, 0})
  902.  
  903.             Case Is = "]"
  904.                 Return BitsOn(New Integer() {0, 0, 0, 0, 0, _
  905.                                              0, 1, 1, 1, 0, _
  906.                                              0, 0, 0, 1, 0, _
  907.                                              0, 0, 0, 1, 0, _
  908.                                              0, 0, 0, 1, 0, _
  909.                                              0, 0, 0, 1, 0, _
  910.                                              0, 1, 1, 1, 0})
  911.  
  912.             Case Is = "{"
  913.                 Return BitsOn(New Integer() {0, 0, 0, 1, 0, _
  914.                                              0, 0, 1, 0, 0, _
  915.                                              0, 0, 1, 0, 0, _
  916.                                              0, 1, 0, 0, 0, _
  917.                                              0, 0, 1, 0, 0, _
  918.                                              0, 0, 1, 0, 0, _
  919.                                              0, 0, 0, 1, 0})
  920.  
  921.             Case Is = "}"
  922.                 Return BitsOn(New Integer() {0, 1, 0, 0, 0, _
  923.                                              0, 0, 1, 0, 0, _
  924.                                              0, 0, 1, 0, 0, _
  925.                                              0, 0, 0, 1, 0, _
  926.                                              0, 0, 1, 0, 0, _
  927.                                              0, 0, 1, 0, 0, _
  928.                                              0, 1, 0, 0, 0})
  929.  
  930.             Case Is = "|"
  931.                 Return BitsOn(New Integer() {0, 0, 1, 0, 0, _
  932.                                              0, 0, 1, 0, 0, _
  933.                                              0, 0, 1, 0, 0, _
  934.                                              0, 0, 1, 0, 0, _
  935.                                              0, 0, 1, 0, 0, _
  936.                                              0, 0, 1, 0, 0, _
  937.                                              0, 0, 1, 0, 0})
  938.  
  939.             Case Else
  940.                 Return New BitArray(35, False)
  941.  
  942.         End Select
  943.  
  944.  
  945.     End Function
  946.  
  947.     'just a helper method, turns the corresponding bits on or in the 1 state
  948.     Private Function BitsOn(ByVal values() As Integer) As BitArray
  949.  
  950.         Dim bits As New BitArray(values.Length, False)
  951.  
  952.         For i As Integer = 0 To bits.Length - 1
  953.  
  954.             If values(i) = 1 Then
  955.                 bits(i) = True
  956.             End If
  957.  
  958.         Next
  959.  
  960.         Return bits
  961.  
  962.     End Function
  963.  
  964. End Class
now i have to call this code for my textbox.. I dono how to call it.. can anyone help me..

Thanks in advance
Apr 7 '15 #1
0 998

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Roy Adams | last post by:
Hello people I've recently been woring with multiple insert from text fields and got that woking fine thanks to the help from people from this forum now i'm trying to deal with multiple update,...
2
by: kak3012 | last post by:
Hi, I am creating a list of text boxes in a PHP code. like below <form name=matrix> <table border=1 width=100%><tr> <td><input type=text size=3 name=box1-1 value=0></td> <td><input type=text...
3
by: chrisspen | last post by:
Is there a way to loop through all instantiated objects and update their classes when a source file changes? I know about Michael Hudson's method...
1
by: Burghew | last post by:
Hi all, I have 3 unbound combo boxes in my form which basically helps me to filter for values. I need to update a text box which will be stored with the value I receive after filtering with the...
6
by: Fabian Härle | last post by:
Hi, if I write to a tet file via a System.IO.TextWriter the changes to the file are not done before I close the file. Is there a possibility to always save the file with every change? The point...
1
by: John Davis | last post by:
I am writing a program that allows user to select the date in a calendar, and it will update the text fields automatically. I created 2 forms. The first form has 2 text fields (start date and...
5
by: =?Utf-8?B?RGF2aWRF?= | last post by:
Hi, I have to open a text file in c# and read few lines and then I need to update some lines in the middle of the file. I can read and write by using the streamReader or streamWriter but I don't...
2
by: John Kotuby | last post by:
Hi all, Maybe this belongs in the Full Text group but I am writing an ASP.NET application with a SQL Server 2005 backend, so I am posing the question here. I have been using fulltext search...
0
by: Marshall | last post by:
Hi In this code everything works fine without any errors, when i edit the row it goes well, but when i change the text in the textbox and press update it still shows the same in gridview row. it...
12
by: SSH1223 | last post by:
I have an Access database form that has 160 text boxes that the name needs to be updated every year. The name is looks like "xxxxxx2015" "xxxxxx2014" and continues. Each year you have to go in and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.