views:

77

answers:

2

I want to make an button that runs an action with the frequency from an number input in Visual Basic .NET . How do I do it? Could someone point me out the syntax of such an action?

@Jon, I think that's C++, I am talking about VB.Net.

@Adam Davis, VB.Net 3.5 and all that I want to do is use an number from "NumericUpDown" to give a button how many times the action the button has to do it.

+4  A: 
    Dim i as integer

    For (i = 1 To InputNumber)
       'Code here
    Next
Jon
more like For i = 1 To InputNumber ... Next
Joey
That looks suspiciously like C#.
Jekke
Converted code to VB.NET ... yuck :)Fixed loop issue also. thanks.
Jon
+1  A: 

This should do the trick.

    For i As Integer = 0 To CInt(NumericUpDown1.Value)
        'Code to execute 
    Next
Ben