This document describes code in Visual Basic 2013 that takes text input from a text box, displays it in a label and adds it to a list box. It also clears the list box items when the list box is clicked. The code sets the text box cursor to the start of the text on each change to select all of the text.
This document describes code in Visual Basic 2013 that takes text input from a text box, displays it in a label and adds it to a list box. It also clears the list box items when the list box is clicked. The code sets the text box cursor to the start of the text on each change to select all of the text.
This document describes code in Visual Basic 2013 that takes text input from a text box, displays it in a label and adds it to a list box. It also clears the list box items when the list box is clicked. The code sets the text box cursor to the start of the text on each change to select all of the text.
Private Sub btnGo_Click(sender As Object, e As EventArgs) Handles btnGo.Click
'lbloutput.Text = "Hello Wolf" lbloutput.Text = txtinput.Text 'masukkan text input ke label lboutput.Items.Add(txtinput.Text)
MsgBox("Cuba-cuba ajah" & txtinput.Text)
End Sub
Private Sub lbloutput_Click(sender As Object, e As EventArgs)
End Sub
Private Sub lboutput_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lboutput.SelectedIndexChanged lboutput.Items.Clear() 'menghapus ketika listbox di klik End Sub
Private Sub txtinput_TextChanged(sender As Object, e As EventArgs) Handles txtinput.TextChanged txtinput.SelectionStart = 0 'cursor di karakter ke 0 (pertama) txtinput.SelectionLength = txtinput.Text.Length 'pilih semua text
End Sub BELAJAR VISUAL BASIC 2013 By Widya Hasil : Karakter dimasukkan melalui kotak putih (txtinput) berupa 1 karakter. Lalu dikirim ke label dan list box.
Jika perintah ini dicomment: txtinput.SelectionStart = 0 'cursor di karakter ke 0 (pertama)