Make A Program Whereby The Input Affects A Variable?

Jun 14, 2011

I've tried to make a program whereby the input affects a variable.

If Label1.Text = "1" Then
store.number1 += 1
End If

[Code]....

I was just wondering if anyone knew of a better way of doing this, as I have to go up to 6 labels, each containing 100 numbers.

View 3 Replies


ADVERTISEMENT

Make A Program That Will Take 2 Numbers Input By The User?

Jan 21, 2010

I am new to VB.Net and programming all together. I am trying to make a program that will take 2 numbers input by the user, Add them together and display the sum. Then take the sum and divide it individually by each number to give you what percent of the sum the numbers are. I'm working on making it a program that will calculate the Hardy-Weinberg equilibrium for my Anthro Class. I'm just doing this for practice for my VB.Net Class. But i will move onto that at a later time. I just want to finish this first.

So.. Here is my code so far. It's not complete yet but this is should be enough to make it function.

[Code]...

View 24 Replies

How To Make A Program In Which The User Can Input A Mathematical Function

Mar 29, 2009

i want to make a program in which the user can input a mathematical function so the program can then work with it. So the user would input something like x^4+x+2 and then an x and the program would calculate f(x). What i don't know is how to let the user input the function.

View 6 Replies

Make Program That Input Data And Update, Delete Records From Access7?

Sep 17, 2011

I have widows7 on my dell notebook than tried to make my personal program on vb 2008

I wand to make program that i can input data and update, delete records from access7

View 4 Replies

Serialport VB2008.net - Input Variable And Output Variable Of This Terminal?

May 14, 2010

I am using vb2008.net express,I test vs2005term it work, can any tell me what is the input variable and output variable of this terminal?how to catch the input and output variable to a textbox1 for sending and a textbox2 for receiving when I press send button? is that possible?

View 1 Replies

Inter-Program Variables - If A Variable In Form1 Is "True" Than, How Can Make A Variable In Form2 Turns To "True" Too?

Feb 11, 2012

I know that

Public Incognito As Boolean

is a variable called "Incognito" that is class-wide that is a boolean.My question is that is there a form-wide variable form that can like communicate with different forms. So if a variable in form1 is "True" than, how can you make a variable in form2 turns to "True" too?

View 1 Replies

VB 2008 Check For Data And Make The Program Stay There Until The Data Is Input?

Aug 3, 2010

I have a program for school project that has input fields for Name, Address, City, State and Zip. I need to error check so that the fields are not empty.I have used If statements that check to see if the fields are empty and shows a message box if they are but if I leave the whole form empty and click the button that activates it, all the if statements go- one by one instead of pausing for the user to input the required data.How do I check for data and make the program stay there until the data is input? I have tried TRY/CATCH but it won't catch this type of error.

this is the

'This program computes customer's bills at the pizza shop for all combinations of
'crusts, toppings, sizes and discounts
Option Strict On
Public Class PizzaForm

[code].....

View 10 Replies

How To Create Dialog Box That Only Affects The Current MDI Window

Jun 8, 2011

I am working on an app that is an MDI. When the user clicks a button on an MDI child, I want to "disable" the current MDI child (and only the current child window), open a new window that has control, and then re-enable the child window when the new window is closed...very similar to using showDialog(). The thing I an having trouble figuring out is how to allow the other child windows to be active at the same time as when the new window is open. If I use the showDialog(), all child windows are disabled

View 8 Replies

Imply A Command That Affects All TextBoxes In The Application?

Aug 10, 2011

I'm wondering if there is a way to write a code that affects every single TextBox in my application... I have about 12 Forms that are all inherited from my BaseForm. I want to affect all of the TextBoxes in those 12 forms The idea is, that every single TextBox would change the text in it to Bold, if the text is not 0 or 0,0 or 0,00. Let's say there is a Form that has about 100 textboxes to indicate different values. Every TextBox that shows the value 0 should be in normal font, but every TextBox that shows any other value should be bolded...

Or should I just do a public function that is called every time a textbox changes value? (Not quite sure how to do this either...)

View 5 Replies

List Box Item Affects Text Box Data

Apr 16, 2010

In teaching myself how to use databases in VB applications, I've managed to

1. Get list box data bound to a database

2. Filter number of items displayed in list box based on user input (letter entered as a filter)[code]...

How can I now have it so that the user selects an item in the list box, and then text boxes on the same form are populated with the relevant data (i.e. database fields matching each text box, with another field from the same table having already been used to populate the list box)[code]...

View 1 Replies

Approach Affects Rebound - Creating The Classic Pong Game

Oct 8, 2011

I am currently creating the classic Pong game in VB.Net. I have a few questions regarding angle of approach and rebound.

For example if the ball hits the wall at roughly a 30 degree angle then it should roughly bounce off the wall at ~30 degrees. This is my first query, how would I achieve this as I cannot figure out how. It is currently bouncing the ball off the wall by altering ballXspeed and ballYspeed by 5 or -5.

My second query is that of the ball hitting the paddle, if the ball is to hit to top 0% - 5% of the paddle it will bounce off at a different angle opposed to if the ball hit the paddle in the 15% - 20% zone of the paddle.

Here is my code in its entirety:

Public Class Form1
Dim ballXSpeed As Single
Dim ballYSpeed As Single
[CODE]...

I understand that you cannot do the work for me and I don't expect you to. Would it be possible for help with the pseudo-logic or a particular area. I forgot to mention that the ball currently bounces off the paddles at a random angle.

Hence:

ballXSpeed = -5
ballYSpeed = New Random(DateTime.Now.Millisecond).Next(-10, 10)

View 1 Replies

Pass A Variable To Another Form Or Else Make The Variable Visible To Both Forms?

Sep 5, 2010

Using Visual Basic 2008 Express. I need to pass a variable to another form. Or else make the variable visible to both forms.

View 4 Replies

Input A Variable Into ZedGraph

Mar 16, 2009

I'm using VB2008 and I have ZedGraph on a form. I want the graph control to display the value of a constantly changing variable. How do I do this in code?

View 1 Replies

Program Function - Says, "The Type For Variable [variable] Will Not Be Inferred Because It Is Bound To A Field

May 18, 2012

Public Class Form1
Dim x, c, number(0 To 19) As Integer
Dim s As Integer

[CODE]...

The variables in the brackets [example] do not actually have brackets in them in the original code. These are where the issues are. For both variables, it says, "The type for variable [variable] will not be inferred because it is bound to a field in an enclosing scope. Either change the name of [variable], or use the fully qualified name (for example, 'Me.[variable]' or 'MyBase.[variable]')." Now, I'm not entirely sure if this is a stupid question or not, as I'm used to VB '98 because that's what we use in my programming class at High School. let me know why this won't work.

-Note: The intention of this program is to continually loop the generation of numbers for this list until I tell it to stop. Button1 ends the program, Button2 generates the list one time only, Button3 is supposed to loop the generation of the list, and Button4 is supposed to end the loop, but not the program.

View 9 Replies

Create Input Box With Variable In Crystal Reports?

Aug 4, 2011

I have a stored procedure that requires a DATETIME variable to display the results in crystal reports. How would I create an input text box and pass the variable to the procedure? Is it even possible to program in vb or C# in crystal reports, or do I need visual studio 2008?

View 1 Replies

Declare A Variable As A String That Is = To The User's Input?

Mar 9, 2012

I simply just to declare a variable as a string that is = to the user's input, and I thought that was done by this:

dim xxx as string =("skdlfjaofhhwa")

But it's not working?

View 1 Replies

IDE - Textbox Input Variable Storage Errors

Feb 18, 2011

Any time I need to store input from a textbox ( ie. "Textbox1.Text" ), I get errors claiming that this is not declared or inaccessible. [Code]. This happens whenever I use Textbox commands.

View 1 Replies

Return A Variable Based On The Input Of A Function (.NET C# Or VB)

Apr 12, 2012

Say I've got the following variables:

Public Shared x As String = "100"
Public Shared y As String = "text"
Public Shared z As String = "something"

[Code]....

But this doesn't do what I want, naturally. What I want is that my function giveVar returns the value of the variable that holds giveVar. For example I call giveVar("x") I want my function to return "100".

Of course this can be done by a Select Case but thats not what I like to do. Is it even possible to call a value based on a string?

[edit:]

Namespace i18n
public NotInheritable Class Settings
Public Shared LanguageCode As String

[Code]....

I think this works so far, BUT I get the following error on the CallByName(Me, varName, vbGet) at the Me : "me is only valid within an instance method"

View 5 Replies

Input Any Words In Textbox - The Program Will Reply By Sound Of What Input In The Textbox

Jul 7, 2009

i use visual basic 6 i already try making a button to play sounds. by clicking the button and the sound will out. so that i want to know were could i start, when you input words in textbox the program will speak what you have type in the textbox.
_

View 5 Replies

Either End The Program Or Start The Program Over In A Visual Basic Console Application - Based Upon User Input?

Apr 8, 2012

I have a procedure at the end of my console application that ask the user to either hit enter to end the program, or type s to perform another search. The issue I'm having is no matter what the user types in the program end. What I would like to happen is if the user types s, then the program starts over and lets the user perform another search. The program is procedural and I need to find a way to start back off at the top of the program which ask the user to type a name to search.

[Code]....

View 1 Replies

Catch The Input And Output Variable To A Textbox1 For Sending And A Textbox2?

Feb 1, 2010

I am using vb2008.net express, I test vs2005term it work, can any tell me what is the input variable and output variable of this terminal? how to catch the input and output variable to a textbox1 for sending and a textbox2 for receiving when I press send button? is that possible? I attach the example of my question this is a a good source, but it is not relate to my problem: [url]...

View 1 Replies

Custom Function Return Type + Input As Variable Datatype?

Dec 1, 2010

I'm wondering whether its possible to have a function's return type and input arguments as a variable.

For example this function:Private Function MyFunction(ByVal argument1 As VariableType) As VariableType

[Code]...

View 6 Replies

Forms :: Can Make Variable Actually Seen As A Variable?

Feb 17, 2011

I have a VBA form in Microstation I am using to try and help automate a task. The only problem I am having is I am reading a textbox (Filebox.Text) and setting it as the variable (FN). It works, because I used Msg.Box (FN) to test it. However, in two of the lines of code, I am trying to use (FN) to pass the typed in filename to the command to run in Microstation. Unfortunently, it gets passed on as (FN).dgn instead of the actual filenale typed into the textbox. Is there a way I can make the variable actually seen as a variable? Code on Pastebin: url....Also, not sure if this is the right section, 100% new to VBA, coming from a world Bashed together.

View 3 Replies

Context Menu Affects Main Menu Drop Down Location

Jul 13, 2010

I open a context menu by right clicking it.

It stays open when the cursor leaves it.

I click a main menu item.

The drop down opens at the top left of the screen.

Not under the main menu item I clicked.

I want to search the Internet but can't guess what key words to use.

View 2 Replies

Persist Program Parameter And Variable Settings From One Run Of The Program To The Next?

Aug 2, 2009

I want to hear some discussion regarding what is the best way to persist program parameter and variable settings from one run of the program to the next. I used to often use the ubiquitous INI type file in VB6 programs but I am aware that these are not formally supported in .Net programs. I also have a major aversion to adding to the already overwhelming bloat of the Windows registry by using that to store values.

[Code]...

View 6 Replies

Make An Input Box Value Required?

Mar 30, 2010

Is there a way to make an input box value required? I have an input box that assigns the value to a label on my form, and I would like to know if you can prevent the user from leaving it blank and instead require a value?

View 7 Replies

Make Input Box Function?

Oct 26, 2010

Am using An inputbox in my form.If i Press OK the code is fine.When i Press cancel the Program displayin an error. Wat should i Do ?

View 3 Replies

Make Sure One Input Is Always Bigger Than The Other

Oct 29, 2009

I would like to know how to make my l(length) always bigger than w(width).eg: message box "Make Length bigger than width" and the 2 inputs, and 3 outputs = [blank]

Public Class Form1 Dim min, max As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code]...

View 4 Replies

How To Make Sure That User Input Is Numeric

Sep 29, 2010

I am writing a small program here and this i=code is straight out a book and it doesn't seem to work. Its supposed to ensure that the users input is numeric and not contain letters.

Module Module1
Sub Main()
Dim user_Input As Single
Dim H As Single
Do
Console.Write("Enter you'r Height in Meters: ")
user_Input = Console.ReadLine
Loop Until IsNumeric(user_Input)
H = CSng(user_Input)
Console.WriteLine("You are {0} meters tall", H)
End Sub
End Module

View 4 Replies

Make A Condition If The Textbox Has An Input In It Or None?

Mar 13, 2012

Is there any way to get me a condition like this? If textbox1 (has string or integer inside) then how to make a condition if the textbox has an input in it or none?

View 2 Replies







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