stupid Textbox help :/

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
6 posts Page 1 of 1
Contributors
User avatar
lesan101
Top Poster
Top Poster
Posts: 193
Joined: Tue Jun 29, 2010 8:10 am

stupid Textbox help :/
lesan101
i have 8 textboxes..

and a button, the button will divide what they entered in the textboxes.

but if the person only entered a number on 2 textboxes only.. then the result will be infinite : (

i dont know what do add so that when you divide, it will only divide whatever textbox they used

or

if they used only 2 textboxes, make it so it adds an automatic "1" for every blank textbox.
Image
User avatar
Zulf
Serious Programmer
Serious Programmer
Posts: 441
Joined: Fri Jun 11, 2010 7:46 am

Re: stupid Textbox help :/
Zulf
Why do they need to divide 8 numbers?
Image
User avatar
lesan101
Top Poster
Top Poster
Posts: 193
Joined: Tue Jun 29, 2010 8:10 am

Re: stupid Textbox help :/
lesan101
Well because i have an option that they can enable, to divide more then 2 numbers.
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: stupid Textbox help :/
mandai
it will only divide whatever textbox they used
You can use sender.Text for that.
User avatar
lesan101
Top Poster
Top Poster
Posts: 193
Joined: Tue Jun 29, 2010 8:10 am

Re: stupid Textbox help :/
lesan101
mandai wrote:
it will only divide whatever textbox they used
You can use sender.Text for that.
i never used sender.text, how would i put it?
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: stupid Textbox help :/
mandai
Actually you would use that if the event was being caused by a textbox. But with a button you would probably use code like this:
Code: Select all
        For i As Integer = 0 To Me.Controls.Count - 1
            If Me.Controls(i).GetType().Name = "TextBox" Then
                If Me.Controls(i).Text.Length = 0 Then Me.Controls(i).Text = "1"
            End If

        Next
6 posts Page 1 of 1
Return to “Tutorial Requests”