Calculator - Cannot Add/subtract/multiply By 0
Jan 11, 2011
I have built a small VB.NET Calculator but whenever I add, subtract or multiply by 0 the answer is always 0. Here is my code:
Spoiler
Option Explicit On
Public Class Calculator2
[Code]....
View 13 Replies
ADVERTISEMENT
Jan 7, 2010
I'm completely new to programming and wondered if you could help me. I've designed a simple calculator that can add numbers together but am now trying to create a subtraction button. This seems more complicated, I've searched various forums but am a little confused and wondered if any of you can help or point me in the right direction. Here is the coding I've done for the Add button (cmdPlus):
Private Sub cmdPlus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPlus.Click
[Code]...
View 4 Replies
Nov 30, 2010
My goal is to connect to my database either manually or using an sqladapater, and get information from two of my databases on sql server 2005. Then I want to take this information and on run-time begin to add/subtract/divide/multiply certain columns and place the information into other columns. I can do this in queries, however, I want to do it on run-time what is the best way to achieve this.I had some of this working, but I just want to start fresh and see how you would go about doing this.
[Code]...
View 2 Replies
May 20, 2010
I'm doing this program in Visual Basic and its supposed to calculate the GPA by entering the completed courses in a listbox. Its does calculate the GPA as its supposed to by adding the values using a "Add to list" button, but i have to also update the value of the GPA if a remove an item from the listbox using a "Remove from List" button. Is there a way a remove the line and also make the subtraction work.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddtoList.Click
'This is the Add button
course = txtCourseName.Text
[code]....
View 2 Replies
Sep 10, 2010
I am a student in South Africa. We have had a long strike in our education department. Thus resulting in our lecturer not teaching code adequately. I have managed to stumble using the text given but I cannot figure out how to multiply or add two values?
View 1 Replies
Nov 3, 2008
As part of a school assignment I have to design a program that allows people to add items to there backpacks but only upto a certain limit depending on age height etc. I completed the code to work out each packs maximum weight and thought I had almost finished but... Now I am trying to use a list box to add up the total weight of items added to each pack (below) but rather than add up I am just assigning the value 5 to the pack1weight.
Code:
Dim pack1weight As Integer
Dim tentW As Single
Dim maxweight1 As Single
[code]....
View 6 Replies
Feb 20, 2011
Im new to vb.net but learnt quiet abit, im using a book and getting to the stage where it gets confusing, anybody know of any videos or a better way to learn? first of all I have connected to a database but i want to beable to get the servername, username and password from a registry file instead of putting it directly into the code,
Also in the database I can add and update records etc... how would I make it take the current value in the table and add / subtract to it then update? eg. in the table i have 60, i want to add 10 to the value so 60 + 10 = 70 update record with 70. etc.
View 3 Replies
Aug 25, 2009
I would like to subtract a month using vb6.. Which function to use??
View 3 Replies
May 13, 2012
I wonder how I can subtract cells in VBA? I want to use an For-loop that subtract column "B" with column "C". I want it to take all the values in kolumn "B" minus ( - ) all values in column "C" in the whole range.
View 12 Replies
Sep 11, 2010
I'm stuck on writing a query to subtract "Amount to pay" with "amount paid", my assignment sheet says to 'use two queries and subtract in vb'. but i still don't really understand it
What the program is supposed to do is:
1. the user types in a specific customer id
2. the button "What is owed by the Customer ID?" runs the query
3. the query returns and opens a HTML with the customer id, the amount to pay, the amount paid and the total amount.so far what i've come up with is:
sSql = "SELECT CustID, SUM(AmountToPay) As AmountOwing, SUM(AmountPaid) As PaidOff FROM Order, Payment WHERE Order.CustID = Payment.CustID AND CustID = " & sSearchValueA & "GROUP BY CustID;"
View 2 Replies
May 19, 2011
I have 15 ofTextBoxs.1 to 5 is TextBoxs have a fix value and 6 to 10 is TextBoxs where the user
can input some value ,finally the textboxs 11 to 15 as a result What i want to do is when user input the value in textboxes(6) then the result automatically raise in textboxes(11).Then when put value in textboxes(7) then result automatically in textboxes(12) and also..
[Code]...
View 9 Replies
Aug 11, 2010
I need to figure out how to multiply hexadecimal numbers in vb .net 2008.Ex / 7E1 x 2 == FC2I was thinking maybe converting the hex to bytes, multiplying that, then back.
View 13 Replies
Jun 6, 2012
i have a problem for put in multiply input
Try
Dim StrSQL As String = "INSERT INTO boranga" & _
"(IdBorangA,Answers)" & _
"VALUES (@B_IdA,@B_Answer);"
[Code].....
by adding more parameter "parameterB_IdA.Value = Label1.Text" for IdBorangA
and "parameterB_Answer.Value = TextBox2.Text" for Answer but the result i get that the table only filling with the data from Label2.text and Textbox2.text.
View 1 Replies
Aug 9, 2008
My problem is printing multiply pages. The below test code prints from a ListView display, being populated from a database, which works fine for the first time, however, all subsequent times page two data is printed over page one data. Is there some way of resetting for successive printing.
Private Sub pd_PrintPage1(ByVal sender As Object, _ ByVal ev As Printing.PrintPageEventArgs)
Dim printFont As Font = New Font("Courier New", 11, FontStyle.Bold) Dim linesPerPage As Integer = 0 Dim yPos As Single = 0 Dim leftMargin As Single = ev.MarginBounds.Left Dim topMargin As Single = ev.MarginBounds.Top Dim
[code]....
View 14 Replies
Feb 21, 2009
how to send multiply files over FTP with Visual Basic 2008 (.NET).
Here is the code I'm using:
Code:
Try
Dim clsRequest As System.Net.FtpWebRequest = _
DirectCast(System.Net.WebRequest.Create("ftp://FTP server here/" & "FTP output filename here" & ".txt"), System.Net.FtpWebRequest)
[code].....
View 4 Replies
Oct 14, 2010
I'm having trouble using Visual Basic. It's my first time with the program that my college course is requiring I use. I'm having problems programing the script for an application. It's suppose to take the rate of a bunch of employees that are programmed into the application using an array, and multiply it by a decimal number that the user inputs into the application.
View 5 Replies
Apr 18, 2009
Suppose I have a string, if I want to basically write it multiple times, depending on some integer value. How I can do that?For example:
dim STR1 as string = "</li></ul>"
dim INT1 as integer = 4
dim STR2 as string = " "
I would like to see the output as
STR2 = "</li></ul></li></ul></li></ul></li></ul>";
Can I achieve it in VB.NET?
View 3 Replies
Feb 1, 2011
I still want to be able to show my code in front of the class/receive feedback. I originally had a program that would calculate the number of calories in your alcoholic beverage.Because I was new at it, I only had one of my beverages listed. I now want to create a combobox/ dropdown menu so that the user can select a standard alcoholic beverage (I have 6 to choose from). All the beverages have different average calorie counts. Once the user selects their beverage from the menu, they can type in the number of servings they consumed (standard size). They would then push a calculate button and would receive their total calorie count. I have everything up and working but everytime I enter a random number of servings and push calculate, it only multiplies by "100" which is the average calorie count for a serving of Light Beer-- the first listed.[code]
I just added the If/Then/Elseif stuff a couple of minutes ago, hoping it would work, but it doesn't. I know this is something simple but like I said, I'm brand new but I have searched everywhere trying to figure this out. I've watch 9 tutorials so far but they all don't really pinpoint what I want my program to do.
View 4 Replies
Dec 8, 2010
I'm looking to design a calculator that adds and subtracts binary numbers. I'm new to this program and stumbling on where to start?
View 6 Replies
May 19, 2010
Can someone show me an example of how to add or subtract when you have the button value going into the textbox like this[code]...
View 4 Replies
Jun 16, 2012
In excel macro i got this two variables:
TimeF_1h = Cells(x, 3) - 0.041667
TimeF_12h = Cells(x, 3) - 0.5
i tried to do the same in Vb.net, but something is wrong i assume i should do it other way.
TimeF_1h = .Cells(x, 3).Value - 0.041667
TimeF_12h = .Cells(x, 3).Value - 0.5
I don't know what does it mean:
0.041667 and 0.5
in excel column are dates in this format:
2011-03-07 16:35:23
View 1 Replies
Dec 12, 2004
can i do this in VB.NEt example i wanna subtract the difference from 8:00 AM TO 12:00 pm how can i do this what namespace do i need? how can i add time? how can i add two dates
View 3 Replies
May 6, 2009
in one textbox i have 10:00 PM and in another textbox i have 12:00 PM....i want to subtract 10:00 PM from 12:00 PM and get result ie 2 hours...how can i perform that?
DateTime.TryParse(TextBox1.Text, d1)
DateTime.TryParse(TextBox2.Text, d2)
View 2 Replies
Mar 15, 2012
I'm Currently working with a payroll system with daily time record.. I'm having troubles with their time records, what i did is this, i created 6 textboxes on the form the 1st textbox is for the AM IN 2nd is for the Lunch OUT the 3rd Is for the total hours worked for the half day, and the same for the 4th to 6th textboxes. I actually get the difference of 2nd and 1st textboxes and show the result at 3rd textbox and same for the 4th-6th textboxes using this code that I also get in this site
Dim TimeA As Date
Dim TimeB As Date
Dim hh As Integer
[Code].....
but i really didn't understand it so right now I don't know how to add the value of textbox3 and textbox6 so I could get the total hours worked of the employee..
View 5 Replies
Nov 3, 2011
I'm writing a program that checks something once a day. When the property has been checked, I store the "Now" value as LastCheckedDate. Since this is a dateandtime, in includes both the value of the date and the value of the time. The next time the program is run, I want to determine if the current value of Now has a different date than the LastCheckedDate. The problem is that functions like Datedif subtract the two values using the times, so if the first check was at 16:30 on 11/2/2011 and the second check was at 9:05 on 11/3/2011, the result is about 16 hours, which is 0 days.
[Code]....
View 6 Replies
Apr 5, 2010
I have two datetimepicker controls one as a start date the other as end date, How do I go about subtracting the values to ge the number of hours? I tried...
[Code]...
View 6 Replies
Aug 21, 2006
I have some problem with my project.
1) I want to convert String (ex : "14/03/1987",...) to system datetime
2) I want this function : Subtract(date1,date2)
==> result: if subtract(date1, date2) > "1 month" then ......do something else if .........do something
View 9 Replies
Jun 15, 2009
I have some problem with my project.1) I want to convert String (ex : "14/03/1987",...) to system datetime2) I want this function : Subtract(date1,date2) ==> result: if subtract(date1, date2) > "1 month" then ......do something else if .........do something
View 5 Replies
Apr 18, 2012
if i had say 10 labels with 10 textboxes how would i save all those labels accosiated with that text box as one text file
say example
label = name ---- textbox1
label2 =surname ---- textbox2
label3 address ---- textbox3
etc
so in the text file it saves it to look like this
name = hayden
surname = doh
address = johnston hwy
View 3 Replies
Jan 31, 2011
How can we multiply the values of the text boxes(reportitems) in rdlc report?
Ex. The expression of TextBoxResult report item is:
=Reportitems!TextBoxPrice.Value * Reportitems!TextBoxQuantity.Value
View 2 Replies