簡體   English   中英

如何才能在 VB.net 中搜索來自 label 的單詞?

[英]What to do to be able to search a word from label in VB.net?

我正在嘗試檢查 label 是否包含某個詞,我該怎么做?

我有帶文本的 label1:這是你的最后一次測試 我有用於搜索的空白 textbox1 我有 button1 用於從 label1 搜索 textbox1 上的輸入文本。

例如,我想搜索“LAST”,我該怎么做?

If I type LAST on the textbox1 Then
If label1 have the word typed on textbox1 Then
Msgbox("You found me")
End If

你能幫助我嗎? 我是新手,我正在使用 VB.net

    If label1.Text.IndexOf(textbox1.Text) <> -1 Then
        MsgBox("Your Message.")
    End If

或者

    If Not string.isNullOrEmpty(textbox1.Text) andAlso label1.Text.ToUpper.Contains(textbox1.Text.ToUpper) Then
        MsgBox("Your Message.")
    End If

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM