5 Replies - 876 Views - Last Post: 28 April 2010 - 12:14 PM Rate Topic: -----

#1 qtex  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 142
  • Joined: 24-October 09

TextBox Value

Posted 28 April 2010 - 10:40 AM

Hey !

I have problems with TextBox value function. I tryed to find some solutions at google but didnt found any. So my problems is that VB shows error. I Hope somebody can help me.

ERROR:Error'Value' is not a member of 'System.Windows.Forms.TextBox'.

My Code:

Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
        If TextBox3.Value > TextBox2.Value Then
            TextBox2.Text = " "
        End If
    End Sub


thanks,

Is This A Good Question/Topic? 0
  • +

Replies To: TextBox Value

#2 keakTheGEEK  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 107
  • View blog
  • Posts: 344
  • Joined: 23-February 10

Re: TextBox Value

Posted 28 April 2010 - 10:44 AM

Change .Value to .Text
If TextBox3.Text > TextBox2.Text Then
            TextBox2.Text = " "
        End If



Was This Post Helpful? 0
  • +
  • -

#3 qtex  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 142
  • Joined: 24-October 09

Re: TextBox Value

Posted 28 April 2010 - 11:14 AM

View PostkeakTheGEEK, on 28 April 2010 - 09:44 AM, said:

Change .Value to .Text
If TextBox3.Text > TextBox2.Text Then
            TextBox2.Text = " "
        End If




I had this before , but its make my "casino roulette game" not correct.
If i have 2500 money then I'll put to bet 2500 then its going to " " yes.
If I'll bet 2499999999 then is able to bet show much or if i want bet 5 then its going to " " too. So i need a better solution for this.
Was This Post Helpful? 0
  • +
  • -

#4 keakTheGEEK  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 107
  • View blog
  • Posts: 344
  • Joined: 23-February 10

Re: TextBox Value

Posted 28 April 2010 - 11:28 AM

Ah... So there's more.

Using .Text instead of .Value takes care of the compiler issue that you posted about. To make the logic of your game correct you need to convert the text values to a numerical value, otherwise you're just comparing the length of the strings. So, try this then
If Convert.ToInt32(TextBox3.Text) > Convert.ToInt32(TextBox2.Text) Then
            TextBox2.Text = " "
        End If




That will compare the numerical values in your text boxes. As for the logic of your application, you may want to create a separate thread for help on that.

This post has been edited by keakTheGEEK: 28 April 2010 - 11:35 AM

Was This Post Helpful? 0
  • +
  • -

#5 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,498
  • Joined: 29-May 08

Re: TextBox Value

Posted 28 April 2010 - 11:34 AM

Textboxes & Numbers Blog Post
Was This Post Helpful? 0
  • +
  • -

#6 qtex  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 142
  • Joined: 24-October 09

Re: TextBox Value

Posted 28 April 2010 - 12:14 PM

Thanks for answering !
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1