Im somewhat new to VB, my first time writing a mildly long program... have a program that will create an unknown number of textboxes, then later I will need it to manipulate those textboxes. I set it up so it names them txt1, txt2, txt3 etc..How can I write a loop that will refer to each of these textboxes by name so I can do what I need with them, ie for example in
For i =1 to x
txti.text = i
next
this would make no sense...how do i write the names correctly so the computer can understate and loop them as txt1, txt2,...?
the purpose of the program is to display the monthly payments on the loan.My homework is to use do while loops instead of for loop.Here is the code for the for loop.
Option Explicit On Option Strict On Option Infer Off
[code].....
Now I'm having some trouble displaying the output using the do while loop, and I'm pretty sure it's a loop problem on my code. However, I cannot seemed to find out what's wrong. I looked at the examples of do while loop in my textbook, but I couldn't find anything useful to my problems of my program.This is the output for the do while loop.
Here's the do while loop code
Option Explicit On Option Strict On Option Infer Off
When I use a For loop in a For loop the Contains Statement dosen't work! Even my custom one! I even tested mine and it works 100% And neither that or the String.Contains function work inside of For Loops And, I know both of them use loops to search through a string.
My function(It will atleast search once):
Function RealContains(ByVal load As String, ByVal needle As String) As Boolean load = load.ToLower
I have a DataGridView which populates from an SQL query just fine in default mode
using these table names [firstName] [varchar](20) NOT NULL, [lastName] [varchar](20) NOT NULL,
[code]....
I have edited the column headers and set the column names to the same values as my table names yet the data is not showing in form load I have set datagridview.AutoGenerateColumns = False I know the data is there if I delete datagridview.AutoGenerateColumns = False then the data is shown with the default headings?
I made project using VB.Net 2005 with multi languages, the first form is MDIParent form with MainMenu and toolbars also there is some changes in properties as righttoleft and text of forms.In my Mainmenu (Menustrip) there is opetion to change the UI Culture and I have already done but I need to change all texts in the form as mainmenu items anf form properties.My quetion is: how can I reload my form again to read the new texts names and mainmenu items names from resx file?
I am doing work for a client who has lost the source code for one of their VB.Net WinForms applications. The assembly they have is not obfuscated at all. I am trying to recover as much of the source as I can as C# source and have tried several tools for decompiling assemblies, including Reflector, ILSpy and JustDecompile (all the latest versions), but they all produce code with a huge number of errors in them. Because of the large number of errors in the generated code, I am going to ask about the specific errors (in different questions), get more directed answers and in this way try shed some light on why all the tools are having difficulty decompiling this assembly. This question pertains to the fact that the code generated by all these tools always have a large number of invalid member variables (fields) such as the following:
private short $STATIC$Report_Print$20211C1280B1$nHeight; private ArrayList $STATIC$Report_Print$20211C1280B1$oColumnLefts; private StaticLocalInitFlag $STATIC$Report_Print$20211C1280B1$oColumnLefts$Init;
why the generated code has these invalid member variables?
Is there any way to get common control names like Save, Copy or Undo Redo in the user's windows language? (I saw this in some programs which weren't made for my windows language. Also the Yes No Massage Boxes will change...)
I am experiencing a problem when trying to convert a rather large VB6 application into a .Net 2005 application. Everytime I try to convert the project I get the following error: "Upgrade Failed: Exception occurred: Can't use character device names in file names"The weird thing is i have tried to convert the project using .Net 2003 and I do not get the error, it does convert.
I have a 5 by 5 matrix I want to populate and I would like to simplify this into for loops. As I understand, I would need 2 for loops to complete this task?
EDIT:I have a ItemList : Dim ItemList As New List(Of String)I wanna append each element from itemlist to a new list for 10 times each, then to start over again.How can I make a loop for each element while there are still elements in the list (10 times each)?I tried this but it's not working.
Private crt As Integer = 0 Private limit As Integer = 0 Private Function getline() As String Dim line As String = ""
[code]....
but I didn't know where to add the 10 times limit and also the current item number(crt)
I'm writing a super small interpreter in vb.net because i need to execute a simple (invented) language so the app understand it and do what ever it needs to do.Everything went well until i reached the control structures and the loops.So my question its, in a code that its executed line by line using a simple for each how can i match the "WHILE ;" AND "ENDWHILE;" and execute the code within it?
The first thing that came to my mind its kind of flag the line of the reader and read the content from that line until find "ENDWHILE;" and the store that to execute late, so keep isolating the code in parts until I've all parts and then execute it.But i'm not so sure how to code it or if my reasoning its correct.PD: I'm using regexs.
I did For each Loop in my combobox, but I noticed that it loops twice. When it reaches the last item, it loops back to the first item. I code it typically: For each itm As Object in combobox.Items
have a problem where I have an application that allows someone to enter two integers. The app then displays all the odd numbers between both integers and all of the even numbers between both integers. There are two text boxes and two labels: even and odd. How would I code a For..Next loop for this type of app. The part where I get confused is what do I determine and how do I
This is for .net frameworke 3.5 and visual studio 2008 in VB.Net.Two things we would like to do: 1) loop repeating node blocks 2) loop (through repeating node blocks) within repeating node block loop First thing:
How do you loop through an xml that has repeating node block (<STRUS name="1000A") and extract the following node? For example you want to extract the IdentificationCode in the node that has <SVALU name="ZRT" and is from pos="9".So, the following example has the IdentificationCodes (TGJ23, PGA12, TPX12)
Is it possible to merge two For Loops into one? I need this because I am using two for loops (1 to 100,000) to work with the data in a collection. The problem with this code is that it takes more than two hours two finish:
Basically I have 4 empty textboxes. I need to calculate the total and averages of the numbers entered in them. So far, I've declared 4 variables and made it equal to the text that was input by the user. I'm stuck with the calculations tough. The user doesn't have to use all 4 boxes. So if he/she only entered 2 numbers, the total is divided by 2, not by 4 for the average. I think I'm supposed to use a for... next loop because the maximum iterations I should do is 4, but I'm not sure how to the code even if it is supposed to use a for loop. Otherwise, the rest of my project seems to work fine.
im new to this site and also a beginner on visual basic During form load, the number items required in the Adult ticket and Child ticket CBO's must be populated with code using a single For Loop.The Items Collection in Design mode must not be used to populate these CBO's1. Movie ticket prices, taxes, and fees are as follows:a. Adult Matinee - $9.25
I have visual studio 2008, and we have been given specific tasks to carry our for our course, we have been asked to implement euclid's algorithm by using a while loop, doing so without the visual part of visual basic whatever that means an example of a question they gave was 1)HCF(88,26)=2 how I would go about doing this, as I am thoroughly confused, and deadlines are fast approaching.
I'm new in programming especially in vb.net and I have a problem displaying the following using for-next loops: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ...and so on...
Initially I wrote this code Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim row As Integer Dim col As Integer Dim txtNumber As Integer = CInt(TextBox1.Text) [Code] ......
The output is this 1 2 3 3 4 5 4 5 6 7 5 6 7 8 9 ... and so on...
The Code has two options. Option one starts with 1 dollar and doubles everyday for 10 days. If this is correct the value should be $1024 but instead it shows double that ($2046)
The second option starts with $100 and adds $100 per day for 10 days. The number should come out to an even $1000 but instead shows $6500
Public Class Form1 Private Sub compareButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles compareButton.Click
I have a matrix for example (10 x 10) which represents 10 nodes. The matrix called MyMat(9,9) The rows of this matrix represent the source node (From Node) and the columns represents target node (To Node). It has 14 links which are randomly distributed. The non zero values represent the connections between nodes.
I have 5 arrays named array1 array2 array3 array4 array5. Each array has 5 elements. I want to access each element in each loop via a for next loop the pseudo code would be something like this.
for i = 1 to 5 / this loop calls the individual arrays for j = 0 to 4/ this loop calls the elements in each array array (i,j) /do some action on the element here next j next i
But as it stands, there is no array called simply array, and I can't figure out how to append the i counter to the word array and thus achieve what I want. The alternative is to have 5 separate loops, one for each array but I feel sure there must be a better way.
I have a listbox on my form which will contain say ten file paths. (10 items in the listbox's item collection)now i want to use the For Each next loop as below
Quote: For Each Item in mylistbox.Items performactionon(item.tostring)
firstly this is not exactly a problem but more like a quiz. I have 3 arrays which I will load data into from a dataset, in the future this set of data might expand and the code will get excessively long, how can I load the data as seen below using loops without using additional array?
create an XML file from a large Oracle dataset. The Oracle dataset contains an ID column and a bunch of different address types. For example, An ID will contain a primary address, secondary address, and a bill to address. Each of the three address types can have multiple addresses but I'm only retrieving the first three.Currently, I'm retrieving three of each address type then joining all of the data together. If I continue with this method, I would have to loop thru the dataset to find the ID and then loop thru the dataset again to find each address for each address type. This doesn't seem very efficient and I'm wondering if there is a better way to do this. Is there a better way to manage the data on the oracle side so that I can have one row for each ID? Or is there a better way to handle this on the .net side with collections and manipulating datasets?