answersLogoWhite

0


Best Answer

When you double click on an object in the Visual Studio IDE while in the design view, it generates an event in the code view. The event generated is the default event for that object. In this situation, when you double click a button it will create a click event. You can access other events by clicking in the Design view and going to the properties pane. From there select the Actions list (lightning bolt) and all of the allowed events for that object are shown. To use one of these, just type in the name of the event next to the desired action and press enter or return on your keyboard.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Loops

For Loop

The For loop is the most popular loop. For loops enable us to execute a series of expressions multiple numbers of times. The For loop in VB .NET needs a loop index which counts the number of loop iterations as the loop executes. The syntax for the For loop looks like this:

For index=start to end[Step step]

[statements]

[Exit For]

[statements]

Next[index]

The index variable is set to start automatically when the loop starts. Each time in the loop, index is incremented by step and when index equals end, the loop ends.

Example on For loopModule Module1

Sub Main()

Dim d As Integer

For d = 0 To 2

System.Console.WriteLine("In the For Loop")

Next d

End Sub

End Module

The image below displays output from above code.

While loop

While loop keeps executing until the condition against which it tests remain true. The syntax of while loop looks like this:

While condition

[statements]

End While

Example on While loopModule Module1

Sub Main()

Dim d, e As Integer

d = 0

e = 6

While e > 4

e -= 1

d += 1

End While

System.Console.WriteLine("The Loop ran " & e & "times")

End Sub

End Module

The image below displays output from above code.

Do Loop

The Do loop can be used to execute a fixed block of statements indefinite number of times. The Do loop keeps executing it's statements while or until the condition is true. Two keywords, while and until can be used with the do loop. The Do loop also supports an Exit Do statement which makes the loop to exit at any moment. The syntax of Do loop looks like this:

Do[{while | Until} condition]

[statements]

[Exit Do]

[statements]

Loop

Example on Do loopModule Module1

Sub Main()

Dim str As String

Do Until str = "Cool"

System.Console.WriteLine("What to do?")

str = System.Console.ReadLine()

Loop

End Sub

End Module

The image below displays output from above code.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What event does Visual Studio generate code for when you double click a button in the Form Designer?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you make a button in visual studio that will make a checkbox turn to the checked state?

Double Click your button and add this code...CheckBox1.CheckedState = CheckBox1.Checked


How do you create code for visual basic?

To program Visual Basic, here are some simple steps to start you off: 1- Buy Visual Studio or download Visual Studio Express Edition (Free Edition) from Microsoft's site 2- Start getting Visual Basic tutorials to learn the language and be able to write programs 3- To start a new project just click "new project" link in the Start Page in Visual Studio 2012 4- Choose "Windows Form Application" for normal windows application development 5- Choose a name for your project and click the button (Im not sure what it sais, Ok or Yes) 6- Visual Studio will automatically make your project's files and will open the design window of form1 and start off! Double click an element to open the code part and its code sub


How can you obtain a button in Castleville on Facebook?

The studio will produce a button.


In visual boy advance what button is select?

the backspace button


What is the select button on visual boy advance?

The Backspace button


How do you unlock the Build Tools Button on Roblox after using Roblox Studio?

you press the build button under the play button


What are the advantages of having a button on webpages?

A button makes a visual cue that a link is present at that spot.


What is button in visual basic?

ez beb et b


Who won the Oscar for Visual Effects in 2008?

The Curious Case of Benjamin Button won the Oscar for Visual Effects in 2008.


In what kind of store can you get your belly button pierced?

Body Piercing Studio


How to use the button on a dell studio laptop?

You would push or click on the buttons to use them on a Dell studio laptop. Each button has its own function.


What is start button on the Visual Boy Advanced on the keyboard?

an A button is usually how you interact with things on any game your playing.