Page 1 of 1

what do we wrong?

Posted: Mon Jul 29, 2013 1:41 pm
by Dummy1912
Hello,

it seems it keep saying fill out the form :(
but i don't get it.

any one?
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If txtfirstname.Text = Nothing Or txtfirstname.Text.Length < 3 Then
                        MessageBox.Show("Fill out the required fields", "give a valid name", MessageBoxButtons.OK, MessageBoxIcon.Information)

                        txtfirstname.Focus()
                    End If
End Sub
i even added for example #CodenStuff thats longer then 3 chars lol
but keeps popup :(

thanks

Re: what do we wrong?

Posted: Mon Jul 29, 2013 1:52 pm
by Shim
It works for me, if I enter text less than 3 it shows the messagebox and if I didn't it doesn't show the messagebox

Re: what do we wrong?

Posted: Mon Jul 29, 2013 2:53 pm
by Dummy1912
so if you add more then 3 then it don't show?
hmm thats weird
with me it keeps showing :(

Re: what do we wrong?

Posted: Mon Jul 29, 2013 3:12 pm
by Shim
yes if I add more than 3 it don't show

Re: what do we wrong?

Posted: Mon Jul 29, 2013 3:13 pm
by Dummy1912
weird weird

still not working even deleted all error messages from every textbox
so 1 left and still that message :(
whats going on cryer;

Re: what do we wrong?

Posted: Mon Jul 29, 2013 3:53 pm
by Dummy1912
ok i think i found the problem
it seems that the text.lenght don't work
and textlenght don't exist in a custom textbox
does anyone know how to implement that into it?

even i already used
Code: Select all
Private Base As TextBox
    Sub New()
        Base = New TextBox
seems still not available :(

also find on msdn
Code: Select all
    Public Overridable ReadOnly Property TextLength As Integer
        Get
            Return TextLength
        End Get
    End Property

If txtfirstname.Text = Nothing Or txtfirstname.TextLength < 3 Then
also tried:
Code: Select all
Dim size As Int16 = txtfirstname.Text.Length
it returns 0 :(
seems with every part you see here its say 0
why?

Re: what do we wrong?

Posted: Mon Jul 29, 2013 4:19 pm
by Dummy1912
Never mind :)
fixt :)