Hi everyone,,,:cheesy:
This is my first post in this forum,,,,,,,
In fact I've one question,,,,,,,
I’m using “Microsoft Visual Web Developer 2005 Express Edition”, and created a class named Class1 which contains one function named dismsg. This function is only displaying a message.
Question: How can I call that function from other forms/pages??

Thanks in advance….

I am assuming it is like vb express.
You declare a variable like:

Private MyObject As Class1 = New Class1

Then you call your function:

Dim MyMessage As String = MyObject.dismsg

Thanks but i didn't work
I've created the following class
Public Class Class1
Function AddNumbers(ByVal X As Integer, ByVal Y As Integer)
AddNumbers = X + Y
End Function
End Class


Now,, How can I refer to this class from other pages??


Try this. Create a new form and add a button. Right click on the form and select view code. Then add this.

Public Class Form1
    Private MyObject As Class1 = New Class1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MessageBox.Show(MyObject.AddNumbers(1, 2))
    End Sub
End Class

Public Class Class1
    Public Function AddNumbers(ByVal X As Integer, ByVal Y As Integer)
        AddNumbers = X + Y
    End Function
End Class

Yes u r 100% correct if i'm using windows application..
but in my case i'm using “Microsoft Visual Web Developer 2005 Express Edition”, which creates classes as separate file. See the attached pic. How can I refer to class bankaccounts as example,,, from the other pages..
Thanks
[IMG]http://anwar84.jeeran.com/untitled.jpg[/IMG]

Then I am over my head. I would have thought they would be simular. Sorry I can't help you. There are guru's on here that can but being the weekend they probably are out shopping. Maybe you can get answer Monday.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.