EDIT: Solved (see comments) I have a For loop inside a sub, and right below it I have a MessageBox function. Everything compiles correctly, however for some reason, if the loop executes and exits successfully, anything outside and below the For doesn't get executed.
[Code]...
it displays only 10 items in the ListBox afterwards. I've searched everywhere, but I did not find anything related to such an issue. I'm kinda puzzled, anyone got a clue of what's going on? EDIT: Forgot to specify, the sub is actually a TextBox.TextChanged event
displaying the first 10 Fibonacci numbers. My code displays the following result: 1, 2, 3, 5, 8, 13, 21, 34, 55 and I need it to also display the first two Febonacci numbers (0 and 1). How would I do that?
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a As Integer = 0
I am calling a sub from a form load event. The procedure that is being called adds columns to a listview and then loops through an array to populate the listview. I have another procedure called after the loop that does not execute when the loop completes. Please advise as to what I am doing wrong for the code not to execute after the loop in the if/then/else statement or why it is not executing if I remove the if/then/else statement and just placed the called sub after the loop or why the code does not go back to the form load event and then call the next called sub.[code]
I have the following code [code] This loop takes sometimes up to a minute to execute. I would like to display a message box giving the user the option of terminating the loop. When I use ShowDialog the loop doesn't execute until DialogResult is returned. When I use Show, the forms buttons are not accessible until do loop is finished. How can I make this work?
I am encountering an error when looping through datarows. I searched SO and tried the solutions, but no luck. Collection was modified; enumeration operation might not execute.
Dim dRow As DataRow For Each dRow In dt.Rows dt.Rows.Add(dRow("CustNum"), dRow("SalesRepName"), dRow("mgrid"), "=""" & dRow("midValue") & """", dRow("dba"), dRow("sysDate"), dRow("statusID")) Next
The error occurs the first time the code hits "Next". What would be causing Collection was modified; enumeration operation might not execute.How can I resolve this error?
So my teacher gave us this assignment that I'm having trouble understanding why she wants us to write outside of the button Private Sub.1. Write the code for the Calculate Total and Grand Total button a. Declare a variable to accumulate the individual totals outside the sub procedures b. Calculate the total by multiplying the selected number of atendees by the selected cost, and display this total in the label next to Total c. Calculate the grand total by adding the total calculated in step 3.b to the grand total variable. Display the grand total next to Grand Total I'm don't understand why she says 1a. I feel like you can just write all the variables in the same Sub on the calculate button.
Have to develop an application that will let me choose between cell phone plans, individual and family plans i have the forms and all choices done,. new forms open and old ones hide to keep it clean. i think i got all the variables declared, and got no debugging errors, but when i select the options, it always gives me the following:
1. adds one more phone than selected
2. only shows phone subtotal, tax and total
3. prices for options and monthly fees never show
Here is my code for all 3 forms
Public Class frmMain Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click End End Sub
I am developing an ASPX VB.NET file. My assignment is to convert an integer representing week of the year into that end date. For example, if user selects Week 4 for 2011, I want to get date = 1/22/11. How do I do this in VB.NET?
I'm supposed to change the keyboard language to Farsi(Persian) by using API functions while the program is running( It's a plain form with a text box). I'm already late for the due date.
I have two drop down boxes in my program. When you select an item from the first drop down, it populates select-able items in the second. When I select something in the second and then change the selection in the first one, the values remain in the second. How do I "reset" the second drop down when the first is changed?
If i have a class called A and a class called B, if B inherits A that means A is the super class and B is the subclass. I have been asked to describe why class A is not an abstract class but as i see it class A is an abstract class A, as it has been created for Class B to use in the future, is it something to do with Class B not being able to access the fields in Class A as although they are private by default?
I am trying to unit test for data being input into a textbox (txtPrice). If it is not numeric, it throws a messagebox stating that the input must be numeric. However, when I unit test, I can't figure out why my test fires the message box twice.THis is my (simple) unit test:
Public Sub txtBoxes_LeaveTest() Dim target As frmEstimate_Accessor = New frmEstimate_Accessor ' TODO: Initialize to an appropriate value Dim sender As Object = Nothing ' TODO: Initialize to an appropriate value[code].....
My understanding is that for unit testing, you declare the sender, and (in this case) set the sender to some value that will trip the message box. 112L should do this on the leave event. I then write my expected, which in this case is 112L, fire the event, and then get the actual out of the text box. I then Assert.AreEqual to ensure the expected and actual are the same.
Working through trace tables and wanted to check to see if my results where correct, I have designed the following code to check each stage of the loop, but the code keeps throwing up an error about casting when i try to run it. I can see when the error comes back that the writeline is holding info but what have i done wrong.
For a school project we need to visualise a computer network graph. The number of computers with specific properties are read from an XML file, and then a graph should be created. Ad random computers are added and removed.Is there any open source project or algorithm that could help us visualising this in VB.net? Or would you suggest us to switch to java.
Update: We eventually switched java and used the Jung libraries because this was easier for us to understand and implement.
I've been taking a class on it this semester and am starting to get very confused and behind. I've been pretty stuck on my hwk assignment for this week and was wondering if anyone could possibly hint at what I'm doing wrong or if I'm just completely way off. The whole rows and columns in arrays seems to be throwing me off now. Also, sorry if this is not the right place to post something like this I was not sure which section this fit under.
I was given an assignment to "write a program to print only even numbers between 6 and 16 using events", but I don't even know where to begin. The main thing I am having difficulty with understanding in this assignment is how I am supposed to specify that it only print even numbers in the given range of numbers.
Am I going to have to do a Mod2 code for each individual number and have it exclude any with the result of 1? Or is there another piece of code specifically designed for such an occassion? Perhaps there is some type of equation I can have the program read in terms of a variable, which holds the values of 6, 8, 10, 12, 14, and 16? I am just genuinely confused on how this is supposed to be programmed.
I have 202 .html files and at the beginning of each file, I need to add a chunk of php code. I could make this myself, but to be honest, it would take me forever and I might as well just manually edit them lol. All the .html files are in one folder.[code] one other thing that would be VERY cool, is if it could add the files that are not edited to a listbox or an outputted text file.
I am learning inheritance in VB.Net. A homework assignment asks me to write a base class with a name (String) property and a ToString method that displays the name. It also asks me to create some child classes of the base class and also implement a ToString method in those child classes. Is it possible for me to call the ToString method from both the child and base class?
[Code]...
Again, I am wondering if there is a way to call the ToString() method within the child class and then base class to generate output something like: "Hello VB.Net This is the name"
Makes the following statement about the code below:
**"The computer evaluates the loop condition in the Do...Loop statment to determine whether the loop instructions should be processed. In this case, the inputsales <> String.Empty condition compares the contenst of the input sales variable to the String.Empty value. As you know the String.Empty value represents a zero length, or empty, string if the inputsales variable is empty, the loop condition evaluates to True and the computer process the loop instructions. *If on the other hand the inputsales variable is not empty, the loop condition evaluates to false and the computer skips over the loop instructions.
Based on the code I think it is the opposite: ...that while the inputsales value is not empty it should evaluate to true and process the loop and if it is empty it should evaluate to false and skip the loop?
I am puzzled by why it does not retrieve the data and keep saying i have a error "InvalidCastException", i am currently doing these in compact framework and is totally new to it, i searched around looking for a way to get data into a listview base on what little i know about java . these are my creation of table and inserting during formload
I am constructing a program, i am new to Visual Basic, but i have past programming experience. I was wondering if anyone knew how to form a loop that could...lets say calculate the answer when two numbers are added together,and it would repeat this thousands of times, etc. And if there is a way, would it be possible to calculate the time taken to complete this loop.
I have written a function that gets the alexa ranking of a given url, now this function works perfectly but I want to loop through a ListView of urls and grab the alexa rank of each item (url) with my function.The code works great if I put a MessageBox in the loop to test that the function is returning a value but when I remove the MessageBox the loop does not work.I need it to loop through adding each result without a MessageBox stop in each loop.
vb For Each Item In ListView1.Items Dim result As Integer result = GetAlexaRank(Item.Text)
So I made a simple patform game where the player has to jump quickly while the platforms move to the bottom of the screen, as to not touch the bottom of the screen. But, I need to know how to create a loop to loop the locations of the platform. This means that after twenty or so platforms, the same platforms come up again, so that the player will have an "endless" game. I've declared all the platform's locations relative to the location of the first repeating platform:
I have this little application that runs a SQL query works great, now I want to have a Start Button run the and display results then System.Threading.Thread.Sleep(300 * 1000) for 5 min then run again and display results and loop till I buttonstop_click. unsure if the sleep is the best method.
I am new to VB programming. I have the following code. When I execute my program only the last value from the loop is displayed in the label. I do write my code so that all of the values (years 1 to 5) show up in the label?
i have a stored procedure that updates TableA with data from TableB when i run it from SQL managment studio it workes, so the SP is error FREE, all i need is to execute this from a button click event.
i tryed this:
Try Dim cnn As New SqlConnection(My.Settings.sqlCn) Dim cmd As SqlCommand = cnn.CreateCommand