4 Replies - 3012 Views - Last Post: 02 September 2008 - 07:24 PM Rate Topic: -----

#1 StealthTools  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 52
  • Joined: 11-March 08

How do you make a textbox = 0 on startup?

Post icon  Posted 02 September 2008 - 06:27 PM

When I compile and run my program I have a textbox that is blank. I made a button that, when clicked, makes Textbox1.text = "0"...

My question is how do I make it so that Textbox1.text = "0" right when my program starts up?

I want to be able to edit the value so it can't be an infinite rule meaning it will always be "0" and you can never change it.

I want to do something like this:
IF Textbox1.text < "0" THEN Textbox1.text = "0"

BUT if Textbox1.text is BLANK with nothing in it, it isn't a number at all so therefore it isn't less than or greater than 0. Right?


IS THIS VB.NET? it's visual basic 2008... I think that this might be talking about "visual basic 6.0" and not everything after it..

This post has been edited by StealthTools: 02 September 2008 - 06:32 PM


Is This A Good Question/Topic? 0
  • +

Replies To: How do you make a textbox = 0 on startup?

#2 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

Reputation: 520
  • View blog
  • Posts: 5,596
  • Joined: 20-March 08

Re: How do you make a textbox = 0 on startup?

Posted 02 September 2008 - 07:06 PM

This is VB.Net
____________________________________________

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load

    TextBox1.Text = "0"

End Sub


That's how you do it on startup.

:)

This post has been edited by Locke37: 02 September 2008 - 07:07 PM

Was This Post Helpful? 0
  • +
  • -

#3 StealthTools  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 52
  • Joined: 11-March 08

Re: How do you make a textbox = 0 on startup?

Posted 02 September 2008 - 07:10 PM

Wow.. I iz soo dumb.. I forgot all about the entire form rofl....

TY :)..
Was This Post Helpful? 0
  • +
  • -

#4 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

Reputation: 520
  • View blog
  • Posts: 5,596
  • Joined: 20-March 08

Re: How do you make a textbox = 0 on startup?

Posted 02 September 2008 - 07:15 PM

No prob.

Glad I could be of assistance! :)
Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How do you make a textbox = 0 on startup?

Posted 02 September 2008 - 07:24 PM

Moved to VB.NET :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1