欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

vb.net列表框刪除 vb中如何刪除列表框里的所選項

vb.net編寫一個為列表框添加刪除選項的應(yīng)用程序,如果該字符串在列表框中,

Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

成都創(chuàng)新互聯(lián)公司成立于2013年,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目做網(wǎng)站、網(wǎng)站設(shè)計網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元常寧做網(wǎng)站,已為上家服務(wù),為常寧各地企業(yè)和個人服務(wù),聯(lián)系電話:13518219792

If e.KeyChar.ToString() = Chr(13) Then

Dim str As String = TextBox1.Text

If Not ListBox1.Items.Contains(str) Then

ListBox1.Items.Add(str)

End If

End If

End Sub

Private Sub btn_Remove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

If ListBox1.SelectedIndex 0 Then

ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)

End If

End Sub

Private Sub btn_Clear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

ListBox1.Items.Clear()

End Sub

VB.NET中要刪除列表框中的多個選項,請問代碼如何編寫。我下面的代碼錯在哪里請指導(dǎo),謝謝

For?i?=?List1.ListCount?-?1?To?0?Step?-1

If?List1.Selected(i)?Then

List1.RemoveItem?(i)

End?If

Next?i

vb中怎樣清空下拉列表框中的內(nèi)容(list里面的)

用列表框的方法list.delete。

List1.RemoveItem 0 '刪除第1項

List1.RemoveItem 1 '刪除第2項

List1.RemoveItem 2 '刪除第3項

List1.Clear '全部清空

擴展資料:

注意事項

獲取單選按鈕的值

$('input:radio:checked').val();

獲取下拉框的值

$('#id option:selected').val();

重置清空值

$("#id")[0].reset();

$("#id").find(':input[type=text]').val(); $('#id').find(':text').val();

重置清空下拉框的值

方式1:

$('#id' option:first').prop('selected','selected');

$('#id').trigger('change.select2');

方式2:

$('#id').val('03').trigger("change");

清除單選框的checked屬性

$("input[type='radio']").removeAttr('checked');

文章標(biāo)題:vb.net列表框刪除 vb中如何刪除列表框里的所選項
網(wǎng)站路徑:http://chinadenli.net/article22/hhpcjc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作企業(yè)建站外貿(mào)網(wǎng)站建設(shè)移動網(wǎng)站建設(shè)服務(wù)器托管App設(shè)計

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)