Exiting From A Recursive Sub Procedure Without Finishing All Iteration
Jan 2, 2009
I've been applying some recursive techniques to the second version of my app. This recursive procedure simply iterates through all nodes in a tree view and tests whether the text in the "department text box" matches the text name of a particular node. If there is a match, then the user's name, stored in the "name" variable, is added as a node to the node that has the same name as the department text box text.
[Code]...
View 5 Replies
ADVERTISEMENT
Jan 9, 2009
I'm designing an app that resets permissions on folders so I've made a treeview that uses GetDirectories to populate itself with all folders on a user's computer. The TreeView has the "checkboxes" property set to true so the idea is that users select all of the folders from this treeview that they want to reset permissions on and then click go.
So once they click go I need to loop through all nodes in the treeview and all subnodes etc and test to see if they are checked, then if they are I want to add each node to a list and then in the next routine I would loop through the list and reset the permissions.This is what I am doing at the moment but I keep finding that the objects added to my list are duplicated.For example if I select C:Test and C:TestTest2 in my treeview then I end up with my List looking like this:
[Code]...
View 12 Replies
Jun 25, 2010
When I start typing a variable (or whatever), VB pops up a little box with all possible variables starting with the letters I already typed. It's really smart!
However this option has somehow been disabled. How do I enable it again?
View 7 Replies
Jan 24, 2010
I have a line shape which I am using as a straight 'finishing line'. As the program runs an identically shaped line shape appears. I am a little confused from where and how it is appearing, as I only have the one line shape. Also, on some runs of the program 'trails' of the cars that are racing across the screen remain.Are these issues something simple I can fix?
View 5 Replies
Mar 6, 2012
[Code]...
i cant figure out how to tie it all together, just trying to find a way to include all of the numbers rather than the ones i listed without writing them all out..
View 1 Replies
Nov 17, 2011
I'm trying to finish an assignment for my Introduction to Visual Basic class. I have to program an application that will determine if a word entered has consecutive letters in the alphabet as a substring of itself. Three examples are T"HI""RST"Y, AF"GH"ANI"ST"AN, and "STU""DE"NT.This is what I have so far:[code]....
However, it doesn't run properly. It says I'm trying to refer to a location that is out of bounds, although I don't see why.
View 12 Replies
Jan 30, 2010
In the process of finnishing up the application. Some NOT all beta testers have had the same problem.
An error box that states: Unhandled exceptions has occurred in your application. If you click Continue, the application will ignor this error and attempt to continue. If you click Quit, the applicatiob will close immediatly.
An error occurred creating the form. See Exception.InnerException for detailes. The error is: Could not load file or assembly "Microsoft VisualBasic PowerPacks vs, Version = 9.0.0.0, Culture=neutral, PublicKeyToken=b03f50a3a' or one of its dependencies. The system cannot find the file specified.
The details displays this: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
Exception Text
CODE:
JIT Debugging
To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.
For example:
CODE:
When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.
This does not happen on all the forms within the app, just some. This happens on some systems running XP and the app runs fine on others running XP. So foar it has run on all systems running Vista. It happens some of the time on Windows 7
View 3 Replies
Jun 2, 2011
when i try to add new data source aftre selecting the table & befor finishing i got the message..An error occured while creating the new data source
An error occured while generating the data source and in error window following error does come Custom tool error: Failed to generate code. Failed to generate code. Invalid access to memory location. [code]
View 1 Replies
Nov 24, 2011
I've previously posted with regards to searching for a string within Excel, although the replies were enough to get my application 'working' the solution was riddled with over-complicated methods.Therefore I bought some books and figured it out for myself and came up with the below (which works like a charm may I add).
Dim oExcel As New Microsoft.Office.Interop.Excel.Application
Dim oBook As Microsoft.Office.Interop.Excel.Workbook
Dim oSheet As Microsoft.Office.Interop.Excel.Worksheet
[code]....
None of these (even if combined) make ANY effect whatsoever.I have also saved the workbook on exit, again to no avail.
View 9 Replies
May 22, 2011
Trying to exit an application but can't seem to kill it without an error."An error occurred creating the form. See Exception.InnerException for details. The error is: The form referred to itself during construction from a default instance, which led to infinite recursion. Within the Form's constructor refer to the form using 'Me.'"The form hasn't loaded yet, it is still in the process of looking for a file to load, if the user doesn't want to specify a working directory, that is their choice, but I need to close the app since it can't continue without it.I'm stuck in a class and can't get back to the main form without it continuing to load everything up. I wan't to force a shut down. [code] I was trying to get back to the main form without loading any more from the class to kill it there. [code]
View 6 Replies
Mar 2, 2009
I have a project that has three windows running at the same time, and exiting anyone one of them leave the others windows running.What is the best way in the code to stop the whole thing executing?
View 1 Replies
Mar 14, 2010
I find myself frequently turning off Intellisense because it adds wrong choices to my code. For example if I try to type "i " (without the quotes) it causes "int " to be put into my code. If I type "for " it may put "form " into my text.
Reaching for the ESC key constantly slows down my typing. (It's such a long way to reach for small hands). Is there an alternative way to exit out of intellisense without the highlighted choice being placed into my code, or is a way I can define a different key for this purpose?
View 2 Replies
Nov 30, 2010
I want to make a button that opens a program. Just for the sake of this post, we'll call the program Notepad.I want the users of my program to open Notepad, but not everyone saves Notepad in the same location. Is it possible to save a value (and the text in the TextBox) so the user doesn't have to retype it every time the program loads?
View 4 Replies
Jun 26, 2011
i am developing a program in visual basic 2010, it involves a non- linear iteration of one of the two variables with a step of .00 and a match at the .000 (3rd) decimal placethere cannot be an exact match between the 2 variable's values but i need the iteration to stop at the nearest possible value.
View 6 Replies
Aug 2, 2010
I have a simple for loop with the following code
For i As Integer = 0 To 4
Snake(i).X = (120 - 20 * i)
Snake(i).Y = 120
SnakeBody(i).Location = New Point(Snake(i).X, Snake(i).Y)
Snake(i).Facing = 3
Next i
But for some reason I unable to debug it. I place a breakpoint on the line Snake(i).X = (120 - 20 * i) and When I try to see what the values are the second time the loop iterates it simply exits the loop.
View 1 Replies
Oct 23, 2010
the application I am developing does not exit completely. i.e. the process can be seen in the Task manager. This happens only when I click on the [X] button on the title bar of the window of my MDI form. If I use the File >> Exit in the menu of my application, it exits without leaving any traces. I have used the "End" method there. But the process stays when I click the [X] on the control box on the title bar.
View 6 Replies
Jul 14, 2011
Why a public variable is not retaining it's value when exiting a subroutine.
I want to search through an array and if a condition is hit then the subroutine exited (thereby holding the index value of a variable named MarkerNo)[code]...
View 3 Replies
Nov 15, 2011
I just can't seem to understand when i am suppose to put Accept outside the LOOP and when i'm suppose to Accept inside the LOOP at the beginning.
View 4 Replies
Jan 23, 2012
Is the warning I am receiving about using the iteration variable in this line a concern.
Dim reportdataforpage = (From reportvar In reportdata Where reportvar.reportpage = pagenum)
View 5 Replies
Feb 23, 2011
how do i add an already exiting .exe or file etc. to vb window form? i mean like make it execute just by clicking on a button or link lable. example like "linklable1" *click* -open up the file or .exe-
here is my code so far
Imports UpdateVB
Public Class Form1
Public updater As New UpdateVB.UpdateVB
[Code].....
View 1 Replies
Apr 6, 2011
i manage to get my dropdown list working, but when change related data in the built program, it does not save it when exiting the program. How do I save the data when exiting?My database name is Database1.sdf?
View 2 Replies
Jun 21, 2010
I need to exit a loop when the spacebar is pressed. [code]
View 18 Replies
Apr 24, 2011
This code is supposed to check if an item already exists in a ListView, and if not, add it. But it still adds it even if it was already there. All variables are set and fully working. The addable string is in an array.
Private Sub btnCombine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCombine.Click
For Each comb As Array In combinables
If comb(0) = Selection1 Then
[CODE]...
View 5 Replies
Aug 25, 2009
how to assign one value to whole array without iteration through it? for example a i have pArray (5000,5000) =1 where all members off array = 1.
View 2 Replies
Jun 13, 2012
I have noticed that when iterating DataGridViewColumns, the speed is greatly reduced if the columns are visible.
For Each col As DataGridViewColumn In cData.DataGridView.Columns
col.Visible = visible
Next
If visible is set to false (and all columns are all currently visible), iterating 264 columns takes around 0.35s, however, if visible is set to true (and all columns are currently invisible), the same process takes around 30s.Does anyone know what would be causing the extra time?Could it something internal to the DataGridView Control?
View 5 Replies
Jun 18, 2009
Does a For-Each loop in VB have an iteration count, or would I have to do that myself?
View 5 Replies
Nov 10, 2009
I've got a for loop. In my loop , I've got a condition , and if that condtion is not met, I need to move on to the next iteration.
So if I have :
For Each txt As Control In tbcell.Controls
if TypeOf (txt) Is CheckBox Then
[code]....
View 3 Replies
Sep 23, 2011
Background: I am working on an ASP.net project that basically fills out a form from user input. The generated form (for reasons which I have no control over) must be a JPEG or TIFF. So the user fills out the web form, which takes all of the input values and meges them into a blank image (jpeg) of the form. Using System.Drawing, it merges all of the text onto the form at designated Points. The points are defined as variables which are modified at runtime to compensate for the resolution of the image (in case it get modified/re-generated at a different dpi). All of this is working fine.
Problem: Currently I have a Sub that determines the dpi of the master image, then adjusts the Points accordingly. However, there are ~50 variables that have to be adjusted. So currently I have the Sub go thru each point variable and manually adjust the X & Y values. I have been working on a Sub that will iterate thru all of the Point variables and do adjustment. Here's a functional sample of what I have working:Imports System.Drawing
Partial Class test Inherits System.Web.UI.Page
[Code]...
This works...sort of. It allows me to grab each variable and modify it, but only in the instance. The original variable in the class is unchanged. Which means that when the program gets to the point where it's drawing text to the image, the points are unmodified. my basic question is: Is it possible to modify the original variable using this sort of process? If not, is the best way to use these modified values to declare the new class instance at a global level, then have the Sub that draws the text use the instance versions of the variables?
I realize that I could define all of the points in an array which would be easy to loop thru and update, but I've named each point variable something meaningful to correspond to the related text to be drawn.
View 1 Replies
Dec 1, 2011
The instructions are as follows:
1. Write a Visual Basic Console Application.Inside the main procedure call a function procedure to input and return a value for a double variable called x, the width of a right triangle.Inside the main procedure call the same function procedure a second time to get a value for a double variable called y, the height of a right triangle.
2. From the main procedure call a function procedure which calculates and returns a value for the hypotenuse equal to the square root of (x squared + y squared).You will have to pass the values of x and y to this function procedure.The procedure should calculate and return a double type value.The value that is returned by this function procedure should be equal to the square root of (x squared + y squared).
3. Also from the main procedure call a sub procedure to display the values of x, y, and the hypotenuse.
View 4 Replies
Feb 23, 2010
In a tic tac toe game I am making there are two blocks of code that are identical except that they access different arrays:[code]Arrays plyrTaken and plyrPairs are used in the first block and cmptrTaken and cmptrPairs are used in the second. Is it possible to wrap these blocks into one Sub Procedure passing the different arrays when the procedure is called?
View 5 Replies