How to Set Values in Silverlight

How to Set Values in Silverlight thumbnail
Create Silverlight projects in Visual Basic.

Knowing how to set values to Silverlight objects can save you time when developing Silverlight applications. Silverlight is a Microsoft product used to build rich interaction applications for the Windows Phone, web and desktop using the .NET Framework. The .NET Framework is a class library made of classes, interfaces and value types required in Silverlight applications. You can create a simple Silverlight application and accomplish the task of setting a value to an object.

Things You'll Need

  • Microsoft Visual Web Developer Express
Show More

Instructions

    • 1

      Start Microsoft Visual Web Developer Express, then select "New Project" from the left pane of the screen. Expand "Visual Basic" under "Installed Templates" and select "Silverlight." Double-click "Silverlight Application" to create a new project.

    • 2

      Leave the default settings in the "New Silverlight Application" dialog box. Click "OK." Double-click "Button" to add a new button to the project. Double-click "Ellipse" to add a new ellipse.

    • 3

      Double-click "Button" to open the "MaintPage.xaml.vb" module. Press "Ctrl" and "A," then press "Delete" to remove all existing code.

    • 4

      Copy and paste the following code to resize the ellipse using the "SetValue" property:

      Partial Public Class MainPage

      Inherits UserControl

      Public Sub New()

      InitializeComponent()

      End Sub

      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click

      Ellipse1.Width = 10

      Ellipse1.Height = 10

      Ellipse1.SetValue(Canvas.TopProperty, 200.0)

      Ellipse1.SetValue(Canvas.LeftProperty, 200.0)

      End Sub

      End Class

    • 5

      Press "F5" to run the program, then click "Button" to resize the ellipse.

Related Searches:

References

  • Photo Credit internet image by Soja Andrzej from Fotolia.com

Comments

You May Also Like

  • How to Display an Image in Silverlight

    Microsoft Silverlight provides you with a language tool for advanced graphics and user interaction on web pages. The Silverlight software is freely...

  • How to Set Up a Startup Page in Silverlight

    Silverlight is a Microsoft programming language for animated Web pages. Microsoft lets you choose the Web page that starts when the user...

  • Silverlight Sockets Tutorial

    Silverlight sockets is a class in the Microsoft language that lets you create chat services in your Silverlight projects. Silverlight is used...

  • How to Set Form Values in a .NET Windows Forms Application

    Windows forms are applications that run on Microsoft's .NET platform. A form consists of one or more controls, such as buttons and...

  • How to Configure Silverlight

    Silverlight is a type of web display protocol designed by Microsoft. Many popular websites that feature streaming media, including Netflix and Hulu,...

  • How to Capture Silverlight

    Silverlight is rapidly becoming the industry standard for streaming video distribution. Owned by Microsoft, it is meant to replace the flash video...

  • How to Use Silverlight

    Silverlight is a program from Microsoft that allows companies to use multimedia on the Internet. It's usable on various different platforms, including...

  • How to Create a Class File in .NET

    Classes provide applications with reusable, portable code. Classes are logical sections of an applications. For instance, the call to a database and...

  • How to Host a Silverlight Page

    Silverlight is a web application framework developed by Microsoft. The framework is similar to Adobe Flash, allowing developers to bring together text,...

Related Ads

Featured