Visual basic - empty

witam

mam taki kod:

Dim tekst As Integer

        tekst = TextBox1.Text

        If tekst = 25 Then

            MsgBox("Dobra!!")


        End If

        If tekst < 25 Then

            MsgBox("Podaj wieksza lb!")

        End If


        If tekst > 25 Then

            MsgBox("Podaj mniejsza lb!")

        End If

chciałbym napisać: gdyby textbox1 było puste, to pojawi się msgbox z informacją aby wpisać dane. Jak to zrobić?

if tekst = EMPTY, 0, czy null - nie działa…

proszę o pomoc

Dim tekst As Integer

        tekst = TextBox1.Text

        If tekst = 25 Then

            MsgBox("Dobra!!")


        End If

        If tekst < 25 Then

            MsgBox("Podaj wieksza lb!")

        End If


        If tekst > 25 Then

            MsgBox("Podaj mniejsza lb!")

        End If


        If tekst = "" Then

            MsgBox("Pole jest puste!")

        End If

w tym kodzie nie ma nic nowego :stuck_out_tongue:

Sparsować tekst(Integer.Parse).

Sprawdzenie czy textbox jest pusty z logicznego punktu widzenia powinno być na samym początku.

Dim tekst As string

tekst = trim(TextBox1.Text)

if tekst="" then

msgbox ("wpisz tekst")

elseif len(tekst)<25 then

msgbox ("za mało znaków")

elseif len(tekst)>25 then

msgbox ("za dużo znakow")

else

msgbox ("dobrze")

endif