comparing object oriented php code with asp.net code

in php

class button{
properties: size, shape, color
method {
//this happens when class is called
}
}

$pink_button=new button();



This is a beginners question for asp.net.

I understand some object oriented concepts in another language, php.


 class
contains method
and many properties  such as color,size,shape, border-thickness

but how is the object instantiated

or how is the class called?

is an object created to call a class?


How can I see this code in asp.net
Please copy paste the code.

How would I see this line in asp.net
$pink_button=new button();

please do not tell me to click on a icon and the code is hidden

I want to learn the code so I can compare php and asp.net
LVL 1
rgb192Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
In C# or VB?
0
rgb192Author Commented:
vb
0
käµfm³d 👽Commented:
OK, so it's a similar idea:  You define the class and create an instance of that class using the New keyword.

Definition
Public Class button
    Public Property Size As Single  ' .NET Requires type information
    Public Property Shape As Shape  ' Assumes you have defined a "Shape" class/structure
    Public Property Color As Color   ' Assuming use of the Color class defined in System.Drawing

    Public Function AFunctionThatReturnsSomething() As String
        Return "Hello World!"
    End Function

    Public Sub AFunctionThatDoesntReturnAnything()
        MessageBox.Show(AFunctionThatReturnsSomething())
    End Sub
End Class

Open in new window


Usage
Dim instance As New button()

button.Size = 3.0F
button.Shape = New Shape("Rectangle")
button.Color = Color.Red
button.AFunctionThatDoesntReturnAnything()

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Loganathan NatarajanLAMP DeveloperCommented:
0
rgb192Author Commented:
thanks

I like this answer because I could not find a clear example of object instatation on the
website link

Dim instance As New button()

button.Size = 3.0F
button.Shape = New Shape("Rectangle")
button.Color = Color.Red
button.AFunctionThatDoesntReturnAnything()
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.