Tema: Re: Del Visual Basic skripto
Autorius: Joint_as
Data: 2009-08-10 21:13:49
Liuks! Dekui. Viskas taip kaip reikia.






Dar reiktu ivedus i paieska teksta iskart spaust "Enter" paieskai (arba 
Button'a)


Radau toki skripta textboxui:
Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As 
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

If e.KeyChar = Chr(13) Then

Button1_Click(Me, EventArgs.Empty)

End If

End Sub



bet viena problema - nuspaudus Enter girdisi toks windowsinis 'klik' garsas 
(butu gerai kad jo nebutu)




"Raimis" <no@mail.com> wrote in message 
news:h5om6d$t6t$1@trimpas.omnitel.net...
> cia "greitukas" . I forma teks isideti button, texbox, label ( 
> defaultiniai vardai nekeisti) ir
> pasikoreguoti atitinkamas konstantas, failo pavadinima
>
>
> Imports Microsoft.VisualBasic.FileIO
> Imports System.Text
> Imports System.Collections
> Imports System.Collections.Specialized
>
> Public Class Form1
>    Dim filename As String = "h:\Test.csv"
>    Const STULPELIS_ID = 1
>    Const STULPELIS_REIKSME = 4
>    Const STULPELIU_SKIRTUKAS = ","
>
>    Dim myVal As New StringDictionary()
>    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As 
> System.EventArgs) Handles MyBase.Load
>
>        Me.Label1.Text = ""
>        Dim fields As String()
>        Using parser As New TextFieldParser(filename)
>            parser.SetDelimiters(STULPELIU_SKIRTUKAS)
>
>            While Not parser.EndOfData
>                ' Read in the fields for the current line
>                fields = parser.ReadFields()
>                myVal.Add(fields(STULPELIS_ID - 1), 
> fields(STULPELIS_REIKSME - 1))
>
>            End While
>        End Using
>
>    End Sub
>
>    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As 
> System.EventArgs) Handles Button1.Click
>        Dim myKey As String = Me.TextBox1.Text
>        If myVal.ContainsKey(myKey) Then
>            Me.Label1.Text = myVal(myKey)
>        Else
>            Me.Label1.Text = "nera"
>        End If
>    End Sub
> End Class
>
>
>
> "Joint_as" <a@a.com> wrote in message 
> news:h5h76g$urc$1@trimpas.omnitel.net...
>> Sveiki,
>> gal kas gali parasyt paprasta skriptuka MS Visual Basic 2008 EE.
>>
>> Formoje tik paieskos laukas + mygtukas ir surandamos reiksmes isvedimas.
>> Ieskoma is  .csv failo.
>> Ivedama i paieska csv failo eilutes pirmo stulpelio reiksme (id) ir
>> surandama ir isvedama i ekrana pvz. tos eilutes 4 stulpelio reiksme.
>>
>> Aciu
>>
>>