Make A Form That Takes User Input 3 Times?

Nov 6, 2010

I'm trying to make a form that takes user input 3 times, and each time compares it to the correct Answer... which is an array of {"C", "D", "A"}.Each time the user's input matches the correct answer ("strCorrectAnswer()"), then I'll add 1 point to intUserScoreCounter. I'm wondering why this code is returning an error (hilighted in blue)? Can I not compare a String to an Array?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnterAnswers.Click
'Handles Enter Answers functionality
Dim strCorrectAnswer() As String = {"C", "D", "A"}

[code].....

View 5 Replies


ADVERTISEMENT

Created An Application That Takes Grades From The User Via Input?

Mar 18, 2010

For a class assignment I created an application that takes grades from the user via input box and adds them to an array called grades. Here is some of the code.

vb.net
Option Strict On
Option Explicit On
Option Infer Off

[Code]...

My problem is that the variable x is an integer and the user input from the InputBox is a string so I get the error: "Option Strict On disallows implicit conversion from 'String' to 'Integer'.I've already submitted this assignment with out the first three lines of code (which allows the code to run flawlessly), but I would like to know how to get around the error while still using the Option Strict On parameter. I am aware of the ToString method but I am not sure of how to use it here or even if it will work here. I've tried to use in a few variations but none worked.

View 14 Replies

Forms :: Make A Model Form, And Copy That Form As Many Times?

Mar 28, 2009

I'm making a program like PostIt! Well, i want to make a model form, and copy that form as many times i want.I think it works with something like frmPostit1 = frmModel.clone()

View 2 Replies

Time Logic - Retrieving Specific Times From A User Form

Oct 10, 2011

I need some help working out the logic when retrieving specific times from a userform I have created. In my userform, users are required to input a start and a end time in 24 hour time format. I am struggling to work out how best to analyze the selected times in order to multiply them by a set of rates, the rates are quite simple:

DayHours rate (day time is between 07:00 - 22:59)

NightHours rate (night time is between 23:00 - 06:59)

I cannot workout the logic to ascertain how many hours have been selected for which rate in an elegant manner, my best attempts so far are clunky and not quite there.

View 6 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 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

Take User Input And Make A Very Simple Bar Graph From It?

Jun 7, 2009

i need to take user input and make a very simple bar graph from it in vb.net.

View 3 Replies

Working On A Program That Takes Input From A Textbox?

Aug 31, 2011

I've been working on a program that takes input from a textbox, removes the punctuation, puts the words into an array (using the split method), and compares the array against a reversed copy of itself to determine if it is a word palindrome or not. I understand the logic, but I'm getting kind of caught up as far as what code to us. This is what I have so far, but no matter what I enter into the text box, nothing happens. I'm completely lost as to what I'm doing wrong.

[Code]...

View 4 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 A Main Menu Which Accepts User Input?

Jul 5, 2011

I'm trying to make a main menu which accepts user input and then checks inputted password for validity against passwords I hardcoded into an array. Firstly, in the for loop, only the first password index is being checked. I'd like the inputted password to be checked against EACH password inside the ValidPasswords() array.

Second, My for loop isn't doing what I want it to do. I'd like to give the user 3 chances to enter a password... If he/she exceeds 3, it tells them they've tried 3 times and exits the form. Right now, it just loops 3 times and exits without giving the user a chance to try again. If I put a return statement in, it just keeps returning and doesn't loop 3 times.

Public Class frmMain
Dim ValidPasswords() = {"1234", "2222", "8918", "9911"}
'Dim ValidPWList As New List(Of String)

[Code]......

View 1 Replies

Make One List Box Dependent On The Other Based On User Input?

Nov 5, 2011

Is there a way to make one list box dependent on the other based on user input. Here's my situation: A teacher has the ability to enter the name of the student into a listbox via a textbox. The teacher may then select the student from the first student list box and input grades that would go into a grade listbox. If the teacher selects another student from the student list box, the grade listbox would either go empty or show the grades inputed for the other student; all the while retaining all previously recorded grades for other students.

View 1 Replies

Make Visual Basic Wait For User Input?

Apr 16, 2011

how to code a function that causes a function to pause until the user either changes a radiobutton or hits the reset button or that will restart the function if one of the entered txt values or comboboxes Index have been changed and the uptade button is clicked.

View 2 Replies

Make A Combobox Only List Based On User's Input Via Autocomplete?

Aug 3, 2010

How to make a combobox only list based on user's input via autocomplete?For example, if user input "A" the combobox only lists all names start letter "A".If user input "AM" the combobox only lists all names start first two letter as "AM" and so on.

View 6 Replies

Pass User Input From One Form To Another

Mar 23, 2011

i have an order system created in vb 2008. I have a new customer form which holds all of the customers details, when i press the enter button i want the information to be passed into an Order Form. They are both textboxes.

[Code]...

View 7 Replies

Check VB, Console Application, User Input To Make Sure They Entered A Valid Number?

Feb 2, 2012

Vb is not my language of choice , but I have to do this for school and I'm not having a very easy time with VB's documentation.I'm just creating a very simple console application that accepts user input: degrees in Celsius, and converts it into Fahrenheit. I want to make sure that if the user just hits enter without entering the degrees in Celsius, then an if else statement will catch and write to enter Celsius again.Here's what I've tried:

[Code]...

View 1 Replies

Open Second Form Based On User Input?

Apr 14, 2009

I am working on a project using Visual Studio .NET 2003.I am trying to open a second form based on user response to Yes/No Message Box. I have tried two different code variations. The first variation is:

Dim MsgAnswer As Boolean
MsgAnswer = True
Dim MsgRes As DialogResult
Dim CustomerInfo1 As New Form

[code]....

With this code I get an exception error: An unhandled exception of type 'System.NullReferenceException' occurred in OrpheyOnOpen.exe Additional information: Object reference not set to an instance of an object.

View 6 Replies

Allow User To Return To The Form And See Prior Input For Editing

Jun 28, 2010

I would like to develop a structure to maintain my user's text input somehow on each form to allow user to return to the form and see the prior input for potential editing. My app has four forms which accept user input and form a string for output to printer. In the eventuality that the user notes a mistake in the input after leaving the app, I would like to develop a structure to "save" the user input at the form level and allow for repopulating the text boxes with the prior user input. Make sense? I have no idea how accomplish that functionality. Maybe it's too complex for my purposes. What do the pros think?

View 2 Replies

Create A Form That Allows A User To Load An Input File?

Dec 8, 2009

how to create a form that allows a user to load an input file? I'm assuming a form like a windows explorer window will be too difficult, or not? If it is then I guess I could just put a textbox on the form and ask the user to input the directory with file name.

View 5 Replies

Take Data User Has Input On Form And Put It Into Access 2007?

Mar 11, 2010

i have a access database with two tables, one for customer and one for booking.

I then have a form application i made in VS 2008 which lets a user enter details such as their name phone number ect into text boxes.

All of the information the person enters thoughout the program is shown via labels at the end, all on one form.

Would it be possible to then have a button that when clicked saves all of this information into the access tables into the correct columns, im sure it must be possible i just don't really know where to start.

View 14 Replies

User Input In A Form To Set Program Parameter In A CMD Window

Dec 3, 2009

I would like to create a form there I can enter three values (A,B,C)in textboxes and then submit these parameter to a program that run in a dos promt windows. Parameter A , B , C..Program.exe /A /B /C..It would be great if I can have a progress bar as well.

View 6 Replies

Validate User Input Before Opening Up The Next Form Page

Oct 23, 2010

I am making a windows application that should validate user input before opening up the next form page. I can get the error messages to show, but after correcting the error, they won't disappear and open up the form.

[Code]...

View 4 Replies

Application Which Takes Input From Drop Down List / Creates Files When Click On That Button For Specified Value In Dropdownlist

Jul 27, 2011

i developed an application which takes input from drop down list and then creates files when we click on that button for specified value in dropdownlist.And if we click on send button it sends to remote database.All the application is working fine. Can any one suggest me how to run this application without user interaction.I dont have any idea about task scheduler, people said it can be done with task scheduler.

View 3 Replies

User Input Arrays To Show In List Box On Separate Form?

Oct 27, 2010

I have created a form which has two things a list box and a button which is labeled "Input Values"The user should click "Input Values" and a new form will appear. This new form will ask the user to enter 10 values into a textbox and click ok after each value. These values are to be stored in an array and displayed in the listbox on the previous form.I am having trouble getting the values of the user to store into my array and displaying into a list box. I have this so far.

Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click

[Code]...

View 27 Replies

Forms :: Generating Custom Code For A Windows Form From User Input

Mar 30, 2009

I am trying to figure out how to generate code from user input. In Visual Studio 2008, Visual Basic.My script always begins with:function Init (Quest)Then from here a user would input a quest name, type and zone in a interface using windows forms.[code]I would also like to have these available on the UI but wont generate unless a user checks a box to add them or there is a box already for them but wont step into the code unless the user enters something into the box.Is there anyone that can explain how I would go about doing this. Or maybe some kind of visual studio plugin that will help me out.

View 2 Replies

VS 2008 - Generating Custom Code For Windows Form From User Input

Mar 30, 2009

How to generate code from user input. In Visual Studio 2008, Visual Basic. My script always begins with:

Code:
function Init(Quest)
Then from here a user would input a quest name, type and zone in a interface using windows forms.
Ex:
Code:
RegisterQuest(Quest, "Kill Zombies", "Heritage", "Firestorm")
end
This part a user would enter in his interface what would an NPC say if accepted.
[Code] .....

What I need is a few text boxs that a user can input "Kill Zombies" or whatever they like and when they push a generate button it will create a file with a .quest extension. All of the code remains the same except for the quotes that would be the user input from the interface. Basically everything in quotes can be changed by the user in an interface. I have created my own functions for when a user accepts, deny and complete a quest. The user just needs to input what should happen then click a generate button to throw it all together as a .quest file to be saved in his or her quest folder for the server to call on later.

I also have many other functions like:
AddQuestRewardFaction --- (Quest, Faction ID, Amount)
AddQuestRewardCoin --- (Quest, Copper, Silver, Gold, Plat)
AddQuestStepObtainItem --- (Quest, Step ID, Description, Quantity, Percentage, TaskGroupText, Item ID(s))
Etc

I would also like to have these available on the UI but wont generate unless a user checks a box to add them or there is a box already for them but wont step into the code unless the user enters something into the box.

View 4 Replies

VS 2010 Can Use Timer When User Tries To Log-in And User Entered A Wrong Password 3 Times

Jan 6, 2012

Can i use the timer when the user tries to log-in and the user entered a wrong password 3 times.i will give the user 5 mins to log-in again with the correct password and if the user enters the wrong pass. 3 times again i will give another 10mins also this is what i want when the user close the program the timer is also their and running that it will give the user the remaining tym on how much tym left 4 him to log-in again.Can i do this in vb.net??i dont know how 2 do this i dont have a clue if it is possible can someone give me a code??

View 9 Replies

Wrong Input For 3 Times And Account Will Be Blocked?

Mar 22, 2012

I am making a banking system in Vb.Net but I had a problem with this function. If a user fails to input the pin number for 3 times, it will be block automatically and will need the admins permission in order for that person to activate the account again. I really don't know how to code the blocking of account and asks for admins authorization to unblock the account again. By the way I'm also using MsAccess as my database for my Bank Simulation.

View 5 Replies

Form Validation - User Does Not Input Valid Text, EXIT Button Also Does Not Works?

Apr 15, 2012

I am doing form validation in VB, I validate the text field data by using txtName_LostFocus function, and on wrong input I used txtName.Focus(). It works well for me. But problem is that as for as, user does not input valid text, my EXIT button also does not works.

View 1 Replies

Count The Number Of Times Letter A - E Is In The Input String?

Mar 16, 2010

input = "my mother is a great lady" output = A -3, B - 0, C - 0, D - 1, E - 2

I wanted to count the number of times letter A - E is in the input string.

View 7 Replies

VS 2010 - Input Validation To Verify User Selected Input For 'cb Length Of Stay'

Jan 15, 2011

I need some help with the input validation of my application. Attached is the code that I have written as well as a screenshot of the front end. I specifically need input validation to verify that the user selected input for cbLengthOfStay is a number between 1-10 as well as input validation to verify the user input for txtMedication, txtSurgicalCharges, txtLabFees and txtRehabilitation is a positive numerical number. Please feel free to critique my attached code. [Code]

View 2 Replies







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