Basicly my instructor said that we have to make a program that will count how many times we enter a number into an inputbox, he also said we had to use a while loop. [code]
I'm trying to loop the inputbox 5 times but I'm not sure how. Dim payroll1 As String payroll1 = InputBox("What is the payrolls for store1", "Inc", , , ) Lblstore1.Text = payroll1 I can get it to loop till a specific amount but not 5 times exactly.
i am trying to make a coin toss program where you toss a coin a certain number of times then repeat it a certain number of times. the problem i have is "heads(counter2)" the word "heads" has a blue error line under it how do i sort the error out and also is all the code right
Public Class Form1 Dim tosses, repeat, heads As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
I am trying to write a program that is a statistical calculator. The way i have it set up is that you press the enter data button and it asks you how many numbers you want entered by inputbox then it proceeds to take the numbers one by one by inputbox. The problem i am having is that i dont know how to take these numbers and then have then printed in the "input" textbox.
Private Sub btnEnterData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnterData.Click Dim N As Integer
I have this program generating a firstname and lastname from a file. When I run this program I enter information in three textboxes. The first two are the salary low and high(salary1.text, salary2.text) and the last one is the number of "copies"(copies.text) that I want.. When I put a number such as 10 in the text box it outputs some of the same names. The firstname file has around 100 records and the lastname file has about 1000 records Why is it generating the same name The problem is even worse if I do something like 1000 copies.. it outputs the same thing 8 times and then does something different another 8 times
Public Class Form1 Dim sex As String Function randomfirstname() Dim infile As IO.StreamReader
could anyone please help me with this1.Create a simple Times Table program which will allow the user to enter an integer value n (between 1 and 20) into a textbox. On the click of a button output to a label the n times tables. Use a For Next loop to perform the repetition.i can output them to a list box but only last one to a label ive been stuck for 3 days.
I am supposed to create a program in my VB.net class to do the following:
1. Prompt the user to enter the beginning number and the ending number.
2. Find the sum of the even numbers between these two values, inclusive.
[Code]...
We are currently using for next statements in the class. I know how to prompt for and utilize the numbers that are input etc. My problem is the EVEN numbers part. I obviously have to determine if the number is even and then use a step value of 2 from there. But not sure how to determine if number is even or odd (guessing to use mod, but totally lost).
I am wounder if anyone might have a web site or no where I can find the information so I understand how to prompt the user to enter the beginning number and the ending number. And then to find the sum of the even number. Now does anyone know what a name convention is ? I have tried to look it up on the forums but cant find nothing on it.
1. create a button 2. when that button is clicked, an inputBox will appear to ask the user how many words they will enter. 3. then display an inputBox for each word.
For example, when the first inputBox appears, I enter "3" (meaning that I will enter 3 words).Then there should be 3 more inputBox (each inputBox allows me to enter only 1 word)After I enter the third word, there will be no more inputBox.How can we FLAG (stop) the inputBox, or let the inputBox know when to stop showing up?
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim timeN As DateTime Dim timeF As Date = #7/11/2009 12:43:20 PM# Dim timeR As TimeSpan timeN = DateAndTime.Now timeR = ????? End Sub End Class TimeN is system time. TimeF is a fixed date and time. All I need is the number of seconds between fixed and system(now) for timeR (and counting).
i am using a combo-box to add different grades to a column in a datagrid and i am using a loop to check if the sum the total number of sum i have made when ever i select a a grade from the combo-box.This is because i want to only add six grade and not more than six but the code i am using is giving me problems This is my code.This code is adding the total grade for me bur i want to check with a loop that will only allow the adition of only six different grade but when i run my program and begin to select the grades it just give me a message form my message box 'This is calculating the grades of an applicant
Private Sub cmbgrade_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbgrade.TextChanged If Me.cmbgrade.Text = "A" Then Me.txttotalaggregate.Text = (CInt(Me.txttotalaggregate.Text) + 1).ToString End If
This text book i have is not very good at all. the exercise's at the end of each chapter ask u to code projects without first covering the basic of what u will need do to code them. (Programming in Visual Basic 2008 Julia Case Bradley + Aninta C. Millspaugh)
Design and code a project to calculate the amount due and provide a summaray of rentals. All movies rent for $1.00 and all customers receive a %10 discount. The form should contain input for the member number and the number of movies rented. INside a groupbox display the rental amount, the 10 percent discount, and the amount due. inside a second groupbox, display the number of customers served and the total rental income.(afterdiscount).Include buttons for Calculate, clear, print and exit. The clear button clears the information for the current rental but does not clear the sumarry information. A print button allows the user to print the form. Do not allow bad input data to cancel the program; instead display a message to the user.[code]...
I have an SQL database with a single table with several colunmns. I want to count how many times a certain number appears in one of the columns. E.g. I have the following: A B C 8 4 6 0 9 3 1 4 6 4 7 1
I want to count the number of times 4 is used in column B. I have looked at using the following, but not sure if this is even the right approach: Dim db as New MainTblDataSet Dim BCount = Aggregate B In db.MainTbl Into Count(B.B = num) where num=the number I am counting the instances of (4 in this case). The hope is that BCount will equal 2, but it returns 0 every time.
Is there a way to loop words for a number of times (like i want to loop a word for only 10 times....How would I go by doing that?)
Quote:
Originally Posted by EXample Like I want to have a textbox and If i put 10 in the textbox It would loop the word ten times or is I put 20 in the textbox it would loop 20 times ..and ..etc...and ...etc...
My code gets a list of words from a txt file and chooses the words randomly. However, the same word can appear more than once and i need to know how to stop this from happeningHere is the code:
Dim aryName As String() = Nothing aryName = File.ReadAllLines(Application.StartupPath & "Randomfnames.txt") Dim randomWords As New List(Of String)
I know it sounds strange but let me it explain. It has a purpose, but really all I'm looking for is the item with the most duplicates.I know it's possible and I've had a few ideas already, though none were successful or practical.What I'm doing here that requires this is creating an intuitive search for clients in a database. You type in a single field and click search. Behind scenes each keyword broken down from the single input field is searched through the table of clients, hitting each column and returning matches. the results are large in numbers, but truly it's the client that appears the same number of times as there are keywords.
How can I count the amount of times a character appears in a string?
The assignment is to create a program with 2 text boxes, label, and a button. We then need to type a phrase into the first text box, and a character in the second. Then click the button and then the label will display the output of how many times the character in the second text box appears in the first.
I have all the above setup except for how to display the amount of times the character appears in the first text box, here's a picture:
I'm trying to run a simple select statement using an ADO recordset. But the resulting recordset returns 3 times the number of rows. For example the query should return 20 rows but is repeating 2 more times and returning 60 rows. When I run the query in Oracle it returns 20 rows.
Here's the code.
sSql = "Select * from Sector" cnnOracle.Open("DRIVER={Microsoft ODBC for Oracle};SERVER=REPDATA.world;UID=auser;PWD=auser;")
Okay, so basically I'm trying to have my application randomly select items from a (multiselect) listbox. I want the user to enter the amount of items they would like randomly selected and it should all happen at the same time. I have the random shuffle down but it only selects one song each time you click the button. How can I loop this code as many times as the user specifies in the textbox?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As Dim shuffle As New Random Main.songlist.SelectedIndex = shuffle.Next(0, Main.songlist.Items.Count - 1)
count the number of times when a user enters a character followed by , and I want to count , number of times. So far here is what I have if you also know a little about the split function can you check to see if what I have is right?
Private Sub Strat0_LostFocus() Dim q1 As New rdoQuery Dim LO As Integer
I am trying to count the number of times a specific character is in a string. The problem is when I run the program the letter doesn't advance from "d" in the string "debugging" and doesn't display the number of time the character "g" is found.
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click Dim letterCount As Integer
I need to know to limit the number of times a radio button can be used. Maybe the number of times the radio button has been used can be stored in an XML file, and when the user wants to reset the counter all they would have to do it delete this file. I really don't know, that's why I'm asking you. But,the program will append a string every time a button is clicked with a radio button selected, I just need to know how to, for instance only allow RadioButton2 to be used in this manner say... 15 times.
I have a list of 100 assets that are pulled from AS400 and shown on a gridview alongside a dropdown box with 6 possible status and a textbox.
If the user selects a status other than "Found" (whether it's "Not Found", "Scrapped", "Sold", "Transferred","Other"), the user cannot leave the textbox empty. They must insert a comment into the textbox. Once the user is done he clicks "Save" and if, let's say, the status is "Sold" and the textbox is empty for all assets then a Message Box pops up saying "Please fill the textbox".
The problem is, the message box pops up 100 times (or once for every asset that has the error).
1) What can I do so that the message box only appears once even when 100 assets have the error?
2) Also, when the message box appears and I click "OK" the information the user had filled up to that point gets erased.
SAVE CLICK EVENT
Protected Sub Save_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Grabar.Click Dim comando As String = ""
I am trying to write a random number function that can just be called from my main module to generate different random numbers. I have tried this several different ways and I am having odd results. Approximately 19 times out of 20 the numbers come back exactly the same, but approximately 1 in 20 they come back as two different numbers. Im using Visual Basic Studio 2008. Here is the code I have so far, or rather, the current version of my many tests I have been running to try and figure it out. Sometimes it takes many runs of the program before the two seperate numbers apear.I've been researching it and have come up with nothing so far.I know I could put them in the module section as two different randoms and it works, but I get extra points if i use a couple classes in my program.This is the main module.
Module Module1 Sub Main() Dim randomNumOne As New RandNum[code]...........
I'm looking to use a timer to change an image for a set number of times & then exit. Am trying the code below but although the TextBox check works the Image skips directly to the second from last & goes no further.
I am trying to code something with nested for loop with the following format:
[CODE]...........
However when the program hits the last value of 'For loop 1', the nested for loops seem to only trigger once instead of the number of times that i specified.
Private Sub populatedgv1() 'setup temptable to store Server data Dim m_table As New DataTable