Forms :: Put Another Integer On Textbox?
Sep 13, 2010can someone put his/codes in with..i have my own but it didn't add when i tried to put another integer on my textbox.
it will just update the first integer i put..
can someone put his/codes in with..i have my own but it didn't add when i tried to put another integer on my textbox.
it will just update the first integer i put..
I have a question regarding using a TextBox in second form within the same project. Currently I am using two forms. From the main form you can click a button which opens the second form. There, I want to type in an integer value into a textbox and use it for the code in my first form. Here's my
[Code]...
I have designed a form with textboxes for numerical entry. I need to validate each textbox so the number entered is an integer, and is between 0-1000. I am struggling to find how to validate the data entry.
View 4 RepliesI am saving scores form my game in to a dadt base but the game involves answering questions mid game that pop up in a seperate for so I have two scores a question score and a game score and at game over i want the two scores to add up and be displayed in one labe wich appers on the game form when my count down hits 0 so I tryed to add them
heres is the game code
Public Class frmplay
Dim score As Integer
Dim total_score As Integer
[Code].....
so I want to add correct answer to score and display it in a label thatwill show on my game form
My problem is that I have two forms, Form1 and Form2 ...on Form1 there is a TextBox called txtTotal (this contains the calculation of Ticket Prices, thus it's a numeric value) and on Form2 there is a TextBox called txtTotal2. All I want to do is get the same number that appears in txtTotal on Form1 to appear in txtTotal2 on Form2 .However whenever I try some of the help tips online such as using a declaring txtTotal as global or friend it dosn't work, and any other code iv tried attempts pass the textbox value as String which brings an error.
View 2 RepliesI would like to know how can I use (read and write) a value in each of my forms. To make it clear: I have 2 forms, Form1 and Form2. I've a string, called string1. If I use in Class Form1 (e.g. at Form1 load) Dim String1 As String, Form2 can't read or change it, because it only exists in Form1. So I would like to have a, let say "general value", a (for example) string, which every form can read&write.
View 7 RepliesHow can I convert a file to an integer array?
Dim StreamRead As New System.IO.StreamReader(FileName)
Dim file() As Integer
Dim loops As Integer = -1
[code]....
Im having trouble changing the value of a textbox to integer. I want the user to enter a start number in the textbox, then when the user presses the button +1 that number is incremented by one.
This is what I have and it does not work Dim TestNumber1 As Integer TestNumber1 = Integer.Parse(TestNumber.Text) TestNumber1 = TestNumber +1
does anybody know of any good Visual studio 2008 books to help me with code. I used to dabble in QBASIC and finding the changover quite difficult.
I have three text boxes in a winform (.net 1.1).
I am expecting the user to type in a positive number or just to leave it as zero (default).
Is there a way that I can check that the user has typed in a number rathet than letters.
As I am coding it in VB.NET, I would prefer it if any answers where in VB style rather than C# or C++.
Basicall, all i need is some simple code that will check if the value in a textbox is a positive integer or not. Something like this:
View 10 RepliesI'm using VB 2010. What is the best way to convert a textbox to an integer?
View 11 Repliesi'm looking for a VB code to format integer into 5 digits and then after that auto increments like (00001 , 00002, 00003) And they are used in a text box field.
Scenario Example : When the user clicks on Add New Record. The empty id text box field will automatically insert a number 00001 on the textbox and if there user wants to add another record the number goes 00002 and so on.
Is there a easy way to input a string or integer into another exe's textbox for example, if i wanted to write into the textbox on the windows calculator '3'.
View 1 RepliesI am new to Visual Basic 2010, but I have been trying to make a line reader with an imported text document into a RichTextBox through an internet source.
I want the RichTextBox's line zero (the first line) to really be line one, but without changing the text in the TextBox to show the change. In other words, I want that change to happen in the background of the program.
I have tried... taking the text from one TextBox and putting it into another, while subtracting an integer value of onean attempt to use a timer to copy the text from one TextBox to another to read the line properly.
I have tried a couple of other things too, but most of them were much more complicated and I could not really explain what each thing did.[code]...
i am trying to make a program and i only want the user to be able to enter numbers and use the backspace this is my code so far.
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim allowedChars As String = "0123456789"
[Code]....
i have tryed adding "ascii char (08)" to the program but its not worked
I am trying to understand the do until loop when adding numbers along with a variable to a new line in a textbox, incrementing each time. My current example is very simple but only returns the first value. I require the output to be incremented automatically, so I thought a do until loop would be best.
[Code]...
My friend and I are taking a visual basic online class. We are total beginners and are having trouble with a programming assignment. We have to create a arithmetic calculator with an enter button multiplication button and an addition button. What we can't seem to code properly is the event handler that allows us to use the enter button when we type in an integer in the textbox. This assignment is detrimental to our grade!
View 6 RepliesI am getting error on the following code
Private Sub tot()
Dim temp As TimeSpan = TimeSpan.Parse(wetothrs0.Text)
wtothrs0.Text = temp.ToString
Dim employeeCost As Integer = CInt(temp.TotalHours)
wtotcost0.Text = employeeCost * hrate0.Text
End Sub
wtotcost0.text is a textbox
employeecost is integer
hrate0.text is integer that is coming from database
In a textbox on my form, I have a value that loads in it that is something like "10.38 - 12.33"
I want it to where the textbox will display whole numbers only. So it will show "10 - 12"
In a combobox populated by a DataTable I am having two issues!The SelectedIndex property will not set 1. Either by integer 2. Or by FindString
[code]...
I have a program that is reading an Excel (xlsx) file and I am trying to take the data found in one of the cells and split it based upon the '@' symbol inside that cell. Here's an example: value in cell is "XXX @ YYY" I declare 3 strings (strOriginal, strA, strH) strOriginal is the value from the cell ("XXX @ YYY") then my code is supposed to split up the values in the Original string based upon that '@' symbol.So when my code is done, strA should = 'XXX' and strH should = 'YYY'.
Here is my code
strOriginal = dtbExcelData.Rows(0).Item(0).ToString
y = strOriginal.IndexOf("@")
strA = strOriginal.Substring(0, y - 1)
[code]....
For some unknown reason, the y integer (in this case, it is '4') changes to a random number (it has changed to 44, 61, 124) and causes the error "Error with Excel file: Index and length must refer to a location within the string. Parameter name: length" to occur.I understand why the error occurs (my y integer is not staying at 4)...I just don't understand why that y integer is changing numbers when it should remain as the indexof the '@' symbol. I'm looking for any suggestions on how to pull out the data after the space after the '@' symbol (the 'YYY' portion of 'XXX @ YYY'). Also sometimes the 'YYY' is only 'YY' as well.
I have a visual basic .net application. It has a sql server database and a dataset for it. I have created an interface to the database (passing through my dataset) to add, delete, save etc records in a table.
The ID entry has identity specification:Yes and increment seed 1 When I add a record, instead of giving 1,2,3... as id in the textbox it produces -1,-2,-3 (Negative integers)
I have a textbox that is filled by the method [code]...
View 3 RepliesI'm using visual basic to code a program to help with weights and center of balance on aircrafts, as I'm my unit's new air load planner. The math isn't hard to do, it's just that much of it is trial and error, and redoing all the arithmetic over and over again until the aircraft's C/B is in acceptable limits can eat some time up. So, since i'm trying to learn programming I thought this might be a good way to use it for a real-world scenario.
[Code]...
I have a form where a number of textboxes are programmatically created within a flowLayoutPanel and named by adding together 2 strings.
With the click of another button i hope to have all the values entered into these text boxes stored in a text file. However, i cant seem to find a way to add strings together to allow me to retrieve the values entered within the text boxes created.
Below is the code i have so far: BTW FLP is my flow layout panel and c is my calculated nmber of textboxes that are created.
Private Sub createTB(ByVal c As Integer)
Dim x1 As Integer = 1
Dim y As Integer = 2
[Code]....
I have this issue with casting....is there anyway i could pass an integer into a label...this is what i have done so far but i am getting this error "A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll"
Dim firstNumber As Integer
Dim secondNumber As Integer
Dim solution As Integer
[CODE].........................
"TEXTBOX is not a member of SYSTEM.WINDOWS.FORMS.TEXTBOX"
Why it is that the text boxes have errors like this even they are in the tax forms..
Label13.Text = sss.Text - philhealth.Text - pagibig.Text
Label18.Text = semiSalary.Text - Label13.Text
[CODE]...
I use the code
Dim Selvk As New Selvkost2
Selvk.PassedText = TextBox29.Text
Selvk.Show()
[code]....
in my second form and the text passes. but I need to pass values from 20 textboxes. do I have to copy the code in my second form 20 times an declare passedtext2 and so on or is there an easier way to do this?
I am creatting an windows application software in which many controls like Buttons, textBox, combobox are remain same in 12 different form. In this 12 diff form the activity of those controls will remain same.The scenareo id
1. I have 12 forms.
2. Each form containing 3 labels (Country, State, City). These labels indicates 3 combobox from which we can select location.
3. Now I need to use these 3 controls in all 12 forms with same activity.
4. When I change forms to another, these buttons shud remain same.
I am getting Errors: Operator '<' is not defined for types 'System.Windows.Forms.Button' and 'Integer'.
Operator '>' is not defined for types 'System.Windows.Forms.Button' and 'Integer'.
Value of type 'Integer' cannot be converted to 'System.Windows.Forms.Button'.
And my program does not work!
Below is my code..............
Private Sub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBar1.Click
ProgressBar1.Value = TextBox1.Text
End Sub
[CODE]...