.net - Recursive For Each Loop Doesn't Seem To Recurse Properly?
Jul 29, 2011
For some reason, it seems that the outer block doesn't seem to update recursively, as I expected it to. I want the loops to add all directories within "C:UsersDrise"to the array internaldirs(). Any advice on the correct way to do this, as it seems I'm doing it improperly?
Static internaldirs() As String
internaldirs.add("C:UsersDrise")
For Each internaldir As String In internaldirs
[code]....
View 2 Replies
ADVERTISEMENT
Feb 11, 2010
have an xml file like this.
<?xml version ="1.0" encoding ="utf-8"?>
<menu>
<menuNode title="Register" value="true">
[Code]....
View 2 Replies
Apr 19, 2010
I am an intermediate programmer with a basic understanding of VB.NET, however, I am having a problem with a special loop named "recursive".
To select the 3rd subitem/node inside a control named "CrumbBar", I have to:
CrumbBar1.SelectedItem = CrumbBar1.Items(0).SubItems(0)
CrumbBar1.SelectedItem = CrumbBar1.Items(0).SubItems(0).SubItems(1)
CrumbBar1.SelectedItem = CrumbBar1.Items(0).SubItems(0).SubItems(1).SubItems(2)
And go through all items, but I need to do this in a LOOP. And I don't know how many nodes I will have to go inside. So I wanna know how can I loop the above code?
View 1 Replies
Aug 18, 2010
I'm trying to make a simple game tree.Previously I used nested loops:
[Code]...
View 10 Replies
Oct 25, 2010
I am descending all the directories of my C drive to get a complete list of all extensions.When I get to: C:Windows.oldDocuments and SettingsAll UsersApplication Data
the program goes into a loop: C:Windows.oldDocuments and SettingsAll UsersApplication Data Application Data Application Data until the path exceeds maximum length (248 characters for the directory).
[Code]...
View 3 Replies
Oct 31, 2009
i've got a problem here whereby my ctype doesn't work.firstly, to replicate my case briefly, i've created an extension of control class
[code]...
father.getheight 'compiler writes: Panel class doesn't support getheight, but I've already converted it to a Control with CType!end sub of course if i dim father as Control it works perfectly, but in my case father may be other objects as well that aren't controls so I had to dim father as a general object, is there a fix so i could properly convert father into a Control object?
View 1 Replies
Jul 8, 2011
So I have a csv file:
[Code]...
My problem is when i use this schema.ini, the 9th, 10th and 11th column of the second row of the csv file doesn't read properly if there's a special character in it (it supposed to be telphone number), i think because the row above is returned as a number(integer) because it's pure numeric:
[Code]...
View 1 Replies
Jul 22, 2011
I have an application that runs perfectly on XP. When I run in on Win 7, it works perfectly when I run it in the IDE but when I deploy it, the application starts OK but some of the functions don't work as they should. I know it could be anything but does anything stand out?
View 1 Replies
Jan 30, 2012
I wrote a program which is editing data from database. I used few tutorials (I`m beginer) and everything is working fine(I can make changes in datagrid). but when I`m trying to save changes made in dataset(e.g. save added record) I can not to that (there are no changes in my access database, but inly in datagrid)what is interesting when I delete record - changes are saved and record is deleted from db. where is my mistake? what is wrong? maybe some tips what can I improve in this small program?
[Code]...
View 10 Replies
Dec 16, 2011
i add this values to listbox
6
7
15
6
[code]....
but in button function when i press the key is shows me this:
15
5
6
6
[code]....
code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Sorted = True
End Sub
View 2 Replies
Mar 24, 2011
I'm having a problem with this code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
clave = Request.QueryString("cve")
If clave = Nothing Then
[code].....
View 2 Replies
Mar 17, 2012
I have this xaml:
<Canvas Width="75" Height="75">
<Button x:Name="button" Background="Olive" Canvas.Left="0" Canvas.Top="0" Width="75" Height="75" Click="button_Click"/>
[code].....
View 1 Replies
Sep 25, 2011
this is my code
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
TextBox1.Text = ""
TextBox1.Text = WebBrowser1.DocumentText
Call baby()
End Sub
[Code]...
View 5 Replies
Nov 20, 2011
Basically my script doesn't properly close Word, and it still remains open. Then when I try to run the script again it says its Read-only as its opened..What I need it to do is - put the TextBox1 info onto the DOC - and print it. I don't want it to save, as it's a template. I've tried saving it somewhere else as a "temp" to get rid of this read only but it still doesn't work.Another issue also is that it's trying to close the document before the printing dialog disappears, so I've had to put a timer
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pName As String[code]....
View 8 Replies
Feb 10, 2011
I've already found evidence of another having this problem. You can see this on this post by someone else:
http:groups.google...096b3fcaa?pli=1
The problem is that when one navigates the combobox via the keyboard, the combobox's information doesn't update. If you click a value with your mouse, though, everything works wonderfully. The link I've mentioned suggests changing the binding from the Text property to the SelectedItem property. I'm very deep into this project and it would be a bit of a nuisance to change the setup so as to allow it to be bound to the SelectedItem property.What I'm wondering is whether or not I can detect the user changing the selected entry in the combobox and tell VB that they "clicked" the value, if that makes any sense.
View 2 Replies
Apr 24, 2012
I'm trying to set the tab order on my form and no matter what I do, it doesn't relearn the new tab position after I change the index. It almost seems like the form is locked.
View 1 Replies
Jan 6, 2012
End A statement which as far as i know doesn't close you program properly and hides errors. Right now i'm being forced to use end because i don't know how else to close my program properly. I'm not sure where my problem is but some of you should be able to fix it. I'm trying to make a game using directx with a game loop. This code is the skeleton of what i'm making.
Public Class Form1
Private ProgRunning As Boolean = True
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Show() 'Make the form appear
Me.Focus() 'Give the form focus
[CODE]...
This code runs alright because end is being used but if you rem end out the error which it's hiding comes out. The error is "Object reference not set to an instance of an object." I'm not totally sure but i'm guessing that the error is refering to the form.
View 9 Replies
Mar 19, 2012
This program is to display the monthly payment and amortization table for three mortgage loans with the same loan amount, but three different interest rates and terms.The ArrayIndex is not looping properly.The first loan displays correctly, but the other two only display the monthly payment and not the amortization table.[code]I originally had the For...Next loop in the DisplayAmortizationTable() sub with the Do Until loop nested in it. My instructor had me move the loop to the Main() sub, but it did not help.
View 4 Replies
Aug 17, 2009
I tried so many times to convert this to DO UNTIL LOOP unfortunately it does not work properly can you help me?
Heres: the code
CODE:
View 7 Replies
Jul 7, 2011
I have prided myself in having a pretty clean code however in the game I am making I have a player view (showscreen) and a host view, which is a copy of the player view (on a smaller screen). This way the host can see what's going on.The problem is that the graphic doesn't dispose properly and Garbage Collector gets it, though I have noticed it will crash if GC doesn't get it in time. The larger the showscreen window the more junk gets put into memory, which sucks.I thought I had everything correctly disposed below but still doesn't get the job done.
[code]...
View 9 Replies
Jul 9, 2010
I have a basic three form application. It doesn't seem to close after navigating through forms. If I were to open the application, and the main form is displayed. If I press the X button, the application closes fine(Goes from processes) If I were to open the application, and then navigate from the main form to another form using me.hide & form1.show, and press the red X on Form1, the application again, closes fine.
[Code]...
View 6 Replies
Oct 26, 2011
While Loop Works then doesn't?
View 1 Replies
Nov 1, 2011
I have a For..Each loop which loops trough all grid's rectangles and changes the fill of them randomly. I change the fill with a color animation. Here's my code:
Dim rand as new random
Dim changeColor As New Animation.ColorAnimation
changeColor.Duration = TimeSpan.FromSeconds(0.5)
[code]....
The problem is that the loop doesn't sleep. I want to trigger the animation, then wait until the rectangle fill is changed and then continue with the rest, but it seems that all of the rectangles fill are changed in the same time.
View 3 Replies
Jun 17, 2010
How do I exit from the recursive loop from the code below. I would like to notify the end-user to select a checkbox in a msgBox before I exit the loop.
[Code]....
View 1 Replies
Feb 22, 2010
I'm making a rock paper scissors program and once I set the current_scene variable to 1, the MainLoop() sub doesn't keep looping, but the sub doesn't exit either. (Form1.vb is the most important file.)
View 9 Replies
Sep 8, 2009
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?
View 7 Replies
Jun 22, 2010
I am looking for a code snippet which opens a image, creates a clone of this bitmap in memory disposes this opened image so that all handles are closed.
Usually we can open a bitmap using this[code...]
the following code however keeps the Image File locked until the application is running, any suggestions how to dispose it properly. (So that no handle is left open )
Things i already tried: use dispose method of bitmap <= doesnt work (need to write implementation)
Using Block also doesnt work.
View 2 Replies
Jan 21, 2011
I am rather irritated at this. I have no clue why looping through controls on a form and in groupboxes leaves out 75% of the controls.
Here's the code I have:
Dim settings As String = ""
Dim gbControl As Control
Dim gbbox As Control
[Code]....
I want to have setting save all settings to an ini file, and not have to reprogram the saving routine when I add a group box or control. At random times, any number of controls can be disabled, checkboxes can be checked and unchecked, radiobuttons can be checked and unchecked. Regardless of the state of the control, I want the control to show up in the loop. But they don't. Only controls that are enabled and only checkboxes that are checked, every other control state is ignored. That's crap, and is definitely not what is needed by any programmer of any type. We're capable of determining if a control is enabled, hidden, checked, visible, and otherwise.
How do I get the controls to be included in the loop regardless of their state?
View 8 Replies
Mar 14, 2011
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?
See below.
Option Explicit On
Option Strict On
Imports System.Globalization
[CODE]...
View 2 Replies
Jun 12, 2011
I am trying to change the background color of a tooltip
I am using tooltip.backgroundcolor = color.colr
No errors but thecolor doesn't change
View 5 Replies