Adding Button in LightSwitch 2012

Here we will see how to add a button to a LightSwitch Application (Visual C#) in Visual Studio 2012.

The following is the procedure for adding a button to a LightSwitch Application in Visual Studio 2012.

Step 1

Open the Solution Explorer.

Sol Ex.jpg

Step 2


In the Solution Explorer, right-click on the Screens and choose "Add Screen".

Add src1.jpg

Step 3

The Add New Screen dialog box appears. Select the "New Data Screen" from the Screen Template, under screen information, choose "None" under screen data and provide some name to the Screen and click the "OK" button.

src1.jpg

Step 4

The Screen Designer appears.

app desi.jpg

Step 5

Click on "Add". A drop down list will appear and select the "New" button.

drop down.jpg

The Add Button dialog box appears on the screen.

cancel.jpg

Now the screen designer contains a button.

button added.jpg

Step 6


Press F5 to run the application.

output.jpg

Step 7

You can also set the image for that specific button.

For setting up the image go to the property window and click on the "Choose Image" link.

prop.jpg

A select image dialog box appears on the screen.

img dialog.jpg

Click on the "Import" button to add an image.

cross.jpg

Step 8

Press F5 to run the application.

out.jpg


Similar Articles