Making A Calculator Application But Variable Inaccessible?

Nov 3, 2009

I'm trying to make a calculator application. Just as practice, as I'm new to visual basic (.NET 4.0) coding. I've got this so far.


[code]...

Note, I've not programmed it to do operations yet, I'm trying to get this sorted out first. My issue is, when I enter my numbers, they do not store as a variable, they both store as zero.

View 22 Replies


ADVERTISEMENT

'variable' Is Not Declared / Inaccessible Due To It's Protection Level

Nov 27, 2010

i'm sort of a n00b to VB and was wondering how to make a variable available across multiple Subs. It's just a test app to get familiar with VB.My Code:[code] "Sentences" is not declared. It may be in accessable due to it's protection level."

View 4 Replies

Error - Variable Is Not Declared, It May Be Inaccessible Due To Its Protection Level

Jul 11, 2011

Today I decided to come up with a program that would be useful for me in VB.net (I have never coded in VB.net before). All is going fine up till this point but I have hit a snag with the error mentioned above. The problem is with the windowssevenexistsonsource boolean under the get get of profiles comment. I will also take any code criticism well as I would like to get out of bad practices before I start! (the sub does end but I have not included that code)

Code:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Check that the entries required are not empty
If String.IsNullOrEmpty(sourceipaddress.Text) Or String.IsNullOrEmpty(destinationipaddress.Text) Then

[code]....

View 1 Replies

Making A Calculator In VB 2008?

Jan 20, 2010

I have to write a program that allows users to specify two numbers and then adds, subtracts or multiplies them when the user clicks on the appropriate button. The out put should give the aritmatic performed and the result. I inserted an attachment on what it should look like also Public Sub btnCompute_Click() Handles btnCompute.Click " here at this one I am getting an error message Error 1 Statement is not valid in a namespace. C:\Users\Tiffney\Desktop\School projects\WindowsApplication1\Form1.vb 1 1 WindowsApplication1"

[Code]...

View 14 Replies

Making A Simple Calculator In VB?

Oct 1, 2005

how to make a simple calculator using vb?

View 11 Replies

VS 2008 Making A Calculator?

Mar 18, 2012

I have a small project from my university they have asked us to make a calculator , well everything is easy so far except the 3 last functions that I need help with.

as we all know vb has already some math functions implemented in its libraries the problem here those functions giving me wrong results I am trying to get math.tan(lblnum.text) math.sin(lblnum.text) and math.cos(lblnum.text)

they don't output the correct numbers any idea why?

View 4 Replies

Making A Calculator With Multiple Function?

Nov 30, 2010

im making a calculator with multiple function but im stuck on two main parts on it. i wrote a big chunk of code for the total calculator. it adds, sub., multi., or divide the amount of numbers the user puts in and then it ask them to enter them in individually using a loops, radio buttons and a listbox. im stuck on the loop because it will as for the 1st number and the last number heres the [code]......

View 5 Replies

VS 2008 Making A Calculator Using Arguments And Functions?

May 6, 2009

Ok. I just took my final for VB and the last chapter we did was on procedures and functions. Functions was the only thing out of this whole semester that I was just completely lost. I'm trying to work on this cause I'm taking Advanced VB next so I wanna know what I'm doing. So I'm trying another tutorial in the book and I'm really lost. Here is what the it wants you to do.

Retail Price Calculator

Write an application that accepts from the user the wholesale cost of an item and its markup percentage. (For example, if an item's wholesale cost is $5 and its retail price is $10, then the markup is 100%)

The program should contain a function named CalculateRetail that receives the wholesale cost and markup percentage as arguments, and returns the retail price of the item.

When the user clicks the Get Retail button, the program should do the following:Verify that the values entered by the user for the wholesale cost and the markup percent are numeric and not negative. Call the CalculateRetail function Display the retail cost as returned from the function.

Here's what the calculator looks like and my code so far.

Public Class Form1
Private Sub btnRetail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRetail.Click

[Code].....

View 4 Replies

VS 2010 Making Calculator (for School Project)?

Jun 30, 2011

I am making a calculator for a school project, I want to have it so it looks similar to windows calc ( with one button for each number & only one text box),My code has a few blank spots but so far it is :

Public Class calc
Private Sub Btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn1.Click
IOBox.Text = IOBox.Text + "1"
End Sub

[code].....

View 5 Replies

"Variable" Is Not Declared - It May Be Inaccessible Due To Its Protection Level

Jun 11, 2012

This is my code:::::

Public
Class Form1
Private Declare
Function Key Lib

[code].....

is my error message:

Error 1 'Label1' is not declared. It may be inaccessible due to its protection level.
Error 2 'Label2' is not declared. It may be inaccessible due to its protection level.
Error 3 'Label3' is not declared. It may be inaccessible due to its protection level.
Error 4 'Label4' is not declared. It may be inaccessible due to its protection level.

View 9 Replies

VS 2010 Making A Calculator With 1 Textbox For Input And Answers?

Feb 5, 2012

so i am new to v basic and as you can see in the picture below that i have 2 textboxes just to put in them 2 numbers and then do mathematical calcualtions on them and a label up there that shows the answer so i wanted to make 1 textbox to type in the 1 st number then press the symbol for example + and then type the 2nd number and then press equal so the result is formed in the same textbox the only problem is idk how i searched google but i couldnt understand here is my source code

[Code]...

View 1 Replies

VS 2008 About Variable Help Me. In My Calculator Project

Feb 27, 2011

just Addition only at this time each number 0 to 9 have this code[code].....here what he says..Write the code for the equals button. There's only three lines in total, and here's a little help.

You need to use the other variable that was set up at the top of the coding window, total2. The variable total1 will be added to whatever is total2.The first line of code will be this

total2 = total1 + (something missing here)

Your job is to supply the missing code. In other words, replace "(something missing here)"

Remember that total1 contains the first number to be added. And you know where that came from. The only thing left to do is to add the second number.For the second line of code, you need to transfer the total2 variable to the textbox.For the third line of code, all you are doing is resetting the variable total1 to zero. That's because after the equals button has been pressed, we have finished adding up. If you wanted to do some more adding up, that total1 will still hold the value from the last time. If you reset it to zero, you can start adding some new numbers.

View 2 Replies

Use Replace When Making One Variable = Two Others Instead Of Just One?

Jun 7, 2009

Okay this one might be a little tougher. I'm using VB that looks like this:

string = Replace(string.ToLower, chr(63), "A")

But I also want chr(63) = "B" as well, like this:

string = Replace(string.ToLower, chr(63), "B")

My problem is that when chr(63) is at the end of a string I need it to be B, and when it's not the end I need it to be A. I suppose that I can use an if/then/else statement. Is there a way to do this?

View 4 Replies

Making An Object Return Its Own Variable Name?

Dec 10, 2009

I was wondering if there's a way I can make my objects return their own variable name as a string, something like this:

Public Class MyClass
Public ReadOnly Property VariableName() As String
Get

[Code]....

Is this possible? I'm fairly sure it should be possible through the System.Reflection namespace, but I can't figure it out.

View 7 Replies

Making Variable Class With Event?

Jun 22, 2010

I haven't quote grasped this whole "class" concept yet, but I'm working on it. When following the instructions below, the "test" portion of this code: "test.variable". It has an underlined error that says that "test" is not declared. If I remove the "test" word then the ".variable" shows not declared. I'm using Visual Studios 8 if that makes any difference. I have a pre-existing variable in a project that I would like to monitor for changes.

Re: Detect variable change.
Make your variable a class with an event.
Make your class:
VB.NET Syntax (Toggle Plain Text)
Public Class myVar
Private mValue As Integer
Public Event VariableChanged(ByVal mvalue As Integer)
[Code] .....

View 1 Replies

Setting A Global Variable Making?

Aug 3, 2010

How do I optimize my code making it DRY approach. I want to make my variable to be on public/general so i can re-use it

Public Class BasicForm
Dim Product1, Product2, Product3, As Integer
Dim firstName, lastName As String

[code]....

I want to move the variables (product1,product2) to somewhere else that I can set it one time and easily access it with other control. What I did before is I alway set the variables to every control.

View 1 Replies

VS 2008 Making A Variable An Object?

May 5, 2011

excuse my coding and term limitations. I'm still learning and have only done what I'd consider basic things. I tried to search this solution for hours and but I'm coming up with nothing.

What I want to do is to reference different check boxes using one loop.

Like this..For xItemNo = 0 To 3

[Code]...

I get the error "Public member 'Checked' on type 'Boolean' not found." I get the fact I'm not able to simply make the text of the code into a variable I can easily insert into the code at will. At least not how I'm trying to do it.How can I dynamically change the check box name I'm referencing in the loop so I don't have to duplicate the code over and over for every check box name?

View 3 Replies

Mortgage Calculator Application : Write/program VB Programs?

Mar 15, 2009

how to write/program VB programs. However, I'm stuck on the mortgage calculator application. Whenever I run the program, I come up with an error stating "Argument 'NPer' is not a valid value." which refers to the Pmt function in the code.

'Dim monthly As Double ' monthly payment rates
Dim years As Double 'total # of years
Dim rate As Decimal 'annual rate
Dim months As Integer

[code]....

View 2 Replies

VS 2008 Developing A Lawn Mowing Calculator Application?

May 2, 2009

laterly I've been trying to think of smarter ways to use code my programs. My Uni class's latest assignment involves a Lawn Mowing Caculator. I've designed a form below, but now I'm stumped for where to start on my code for it.

View 4 Replies

Calculator Application - Use Datatype - Variables Be Single Double Decimal ?

Mar 11, 2009

I am writing an calculator application and i dont know what datatype to use. i mean should the variables be single, double, decimal...?

View 1 Replies

Make The Application Adaptable To The Other Computers After Making Exe Application

Dec 14, 2009

I am making a exe application and i am using mysql as my database. So the thing is, when i change to a new computer, i need to change the file path for the database connection string to that computer.

like below:

Dim connectionString As String = "Data Source=----------SQLEXPRESS;Initial Catalog=Flexlink;" & "Integrated Security=SSPI;"

i need to change the data source = --------------- SQLEXPRESS to the computer name that i am using for my project.

May i ask is there any method such that the user dont have to go in to the source code to change the computer's name like those normal installer?

Just install and the application will run according like any exe file that we buy.

View 1 Replies

Making Quiz - Assigning Point Value To Variable Depending On Answer

Nov 15, 2010

I am thinking is to have a question, then between 2-4 answers, and depending on the answer a point value gets assigned to a variable, but then when that one question is answered you can click a button that moves to a next page type of thing with a new question on it. I think I could probably figure most of this out but when it comes to switching to a different question I am not sure how I would do that.

View 11 Replies

' ' Is Not Declared / It May Be Inaccessible Due To Its Protection

Mar 13, 2012

I'm getting the error ' ' is not declared.It may be inaccessible due to its protection level with the following code. [code] I tried changing from private sub to Public and adding Imports System.Windows.Forms.TextBox but that didn't fix my problem.

View 5 Replies

Make A .DLL File Inaccessible

Oct 15, 2011

I am using a DLL file as my license file for a VB.NET project and was wondering if there was a way to make it locked so notepad can't open it and edit the data stored in there.

View 6 Replies

'<Procedure>' Is Not Declared. It May Be Inaccessible Due To Its Protection Level

Oct 28, 2010

I am unable to call public routines in a public class in AppCode.To debug, I built a new blank website project with a public class Class1 in AppCode and a public function Foo returning a string "Hello World".A sub CallFoo calls Foo without error if CallFoo is in Class1. If CallFoo is moved to a new class Class2 I get the above error.I have rebuilt this test site from scratch targeting Framework 3.5 and 4 with the same error. Oddly, I have found I am able to reference public constants without error.

View 2 Replies

Asp.net - 'ZoneDropDown' Is Not Declared - It May Be Inaccessible Due To Its Protection Level?

May 7, 2012

I have a bunch of controls in my .aspx page. Also, the designer is also generating code for those controls.When i am trying to use any of these controls, i am getting the above mentioned error for all the controls in the page.

View 1 Replies

DropdownList Not Declared - Inaccessible Due To Protection Level

Oct 6, 2011

I'm trying to get the model dropdown be affected by + selCurrentManuf.Text. I get this error:
'selCurrentManuf' is not declared. It may be inaccessible due to its protection level.

I can access the drop down in another part of the page like this..
Dim sc1_currentmanuf As String = CType(e.Item.FindControl("selCurrentManuf"), DropDownList).Text
However in the function I am trying to use selCurrentManuf does not have access to e.

View 3 Replies

Execute Is Not Declared.it May Be Inaccessible Due To Its Protection Level?

May 4, 2010

Dim msg As String
msg = "Hello"
Execute(msg)

View 4 Replies

.net - Making A Vb6 Application That Can Run On Android?

Jan 20, 2012

Sir, I am a vb programmer. I want to develope a vb application that can be run on an android phone or tablet.What I should do for that and how can i install this application on android phone or tablet and run it successfully? Generally i use ms access or sql server for my desktop application. Which data base should i use with my vb application on android phone or tablet?

View 2 Replies

Making A .net Application DPI-Aware?

Jan 24, 2010

I have an application written in VB.net 2003, and I would like to make it 'dpi-aware', but I haven't the faintest idea how to even begin. I am an experienced coder, but this is throwing me completely.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved