Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,299 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,438 people online right now. Registration is fast and FREE... Join Now!




How do you make a textbox = 0 on startup?

 
Reply to this topicStart new topic

How do you make a textbox = 0 on startup?, Simple?

StealthTools
2 Sep, 2008 - 05:27 PM
Post #1

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
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:
CODE
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: 2 Sep, 2008 - 05:32 PM
User is offlineProfile CardPM
+Quote Post

Locke37
RE: How Do You Make A Textbox = 0 On Startup?
2 Sep, 2008 - 06:06 PM
Post #2

I'm not a thief...I prefer the term TREASURE HUNTER!
Group Icon

Joined: 20 Mar, 2008
Posts: 1,002



Thanked: 39 times
Dream Kudos: 325
My Contributions
This is VB.Net
____________________________________________

vb
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.

smile.gif

This post has been edited by Locke37: 2 Sep, 2008 - 06:07 PM
User is offlineProfile CardPM
+Quote Post

StealthTools
RE: How Do You Make A Textbox = 0 On Startup?
2 Sep, 2008 - 06:10 PM
Post #3

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


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

TY smile.gif..
User is offlineProfile CardPM
+Quote Post

Locke37
RE: How Do You Make A Textbox = 0 On Startup?
2 Sep, 2008 - 06:15 PM
Post #4

I'm not a thief...I prefer the term TREASURE HUNTER!
Group Icon

Joined: 20 Mar, 2008
Posts: 1,002



Thanked: 39 times
Dream Kudos: 325
My Contributions
No prob.

Glad I could be of assistance! smile.gif
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: How Do You Make A Textbox = 0 On Startup?
2 Sep, 2008 - 06:24 PM
Post #5

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Moved to VB.NET smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 06:10AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month