none
Teclado Numerico RRS feed

Respostas

  • Felipe,

     

    Existe um tutorial no MSDN que não encontro no momento a referência para te passar. Abaixo segue o código do artigo.

     

    Imports System
    Imports System.Windows.Forms
    Imports Microsoft.WindowsCE.Forms

     

    Public Class Form1
       Inherits System.Windows.Forms.Form
       Private mainMenu1 As System.Windows.Forms.MainMenu
       Private mi1 As System.Windows.Forms.MenuItem
      
       ' Text box for name.
       Private textBox1 As System.Windows.Forms.TextBox
       ' Text box for phone number.
       Private textBox2 As System.Windows.Forms.TextBox
       ' Text box for city.
       Private textBox3 As System.Windows.Forms.TextBox
      
       ' Labels for name, phone, and city
       Private label1 As System.Windows.Forms.Label
       Private label2 As System.Windows.Forms.Label
       Private label3 As System.Windows.Forms.Label
      
      
       Public Sub New()
         
          InitializeComponent()
         
          ' Add a menu to close the application.
          mi1 = New MenuItem()
          mainMenu1.MenuItems.Add(mi1)
          AddHandler mi1.Click, AddressOf mi1_Click
          mi1.Text = "Done"
         
          ' Set input mode for name text box to AlphaCurrent.
          InputModeEditor.SetInputMode(textBox1, InputMode.AlphaCurrent)
         
          ' Set input mode for phone number text box to Numeric.
          InputModeEditor.SetInputMode(textBox2, InputMode.Numeric)
          ' Set input mode for city text box to AlphaCurrent.
          InputModeEditor.SetInputMode(textBox3, InputMode.AlphaCurrent)
       End Sub
       
      
      
       Protected Overrides Sub Dispose(disposing As Boolean)
          MyBase.Dispose(disposing)
       End Sub
      
      
       Private Sub InitializeComponent()
          Me.mainMenu1 = New System.Windows.Forms.MainMenu()
         
          Me.mainMenu1 = New System.Windows.Forms.MainMenu()
          Me.textBox1 = New System.Windows.Forms.TextBox()
          Me.textBox2 = New System.Windows.Forms.TextBox()
          Me.textBox3 = New System.Windows.Forms.TextBox()
         
          Me.label1 = New System.Windows.Forms.Label()
          Me.label2 = New System.Windows.Forms.Label()
          Me.label3 = New System.Windows.Forms.Label()
          '
          ' textBox1
          '
          Me.textBox1.Location = New System.Drawing.Point(64, 8)
          Me.textBox1.Size = New System.Drawing.Size(104, 25)
          Me.textBox1.Text = ""
          '
          ' textBox2
          '
          Me.textBox2.Location = New System.Drawing.Point(64, 40)
          Me.textBox2.Size = New System.Drawing.Size(104, 25)
          Me.textBox2.Text = ""
          '
          ' textBox3
          '
          Me.textBox3.Location = New System.Drawing.Point(64, 72)
          Me.textBox3.Size = New System.Drawing.Size(104, 25)
          Me.textBox3.Text = ""
          '
          ' label1
          '
          Me.label1.Location = New System.Drawing.Point(8, 8)
          Me.label1.Size = New System.Drawing.Size(56, 22)
          Me.label1.Text = "Name"
          '
          ' label2
          '
          Me.label2.Location = New System.Drawing.Point(8, 40)
          Me.label2.Size = New System.Drawing.Size(56, 22)
          Me.label2.Text = "Phone"
          '
          ' label3
          '
          Me.label3.Location = New System.Drawing.Point(8, 72)
          Me.label3.Size = New System.Drawing.Size(56, 22)
          Me.label3.Text = "City"
          '
          ' Form1
          '
          Me.Controls.Add(textBox1)
          Me.Controls.Add(textBox2)
          Me.Controls.Add(textBox3)
          Me.Controls.Add(label1)
          Me.Controls.Add(label2)
          Me.Controls.Add(label3)
          Me.Menu = Me.mainMenu1
          Me.Text = "Input Mode Demo"
       End Sub
       
      
       Shared Sub Main()
          Application.Run(New Form1())
       End Sub
      
      
       Private Sub mi1_Click(sender As Object, e As EventArgs)
          Me.Close()
       End Sub
    End Class

     

    Espero ter ajudado.
    segunda-feira, 28 de julho de 2008 03:50