Ok i have 3 buttons and they all lead to the same form, which i want them to but the problem is that i want certain results to show up depending on which of the 3 buttons is clicked. i hope i explained well enough. thanks
Printable View
Ok i have 3 buttons and they all lead to the same form, which i want them to but the problem is that i want certain results to show up depending on which of the 3 buttons is clicked. i hope i explained well enough. thanks
Give your Results form an overloaded constructor that takes a parameter. Each of the buttons should pass in a different parameter. Your form should use the parameter to decide what results to show.
im a beginner so how do i do that? you don't have to show me the whole thing, just get me started. Thanks for replying
is there a tutorial somewhere? please help
I found something at a website. Is this what i need to do?
VB Code:
Private _CallingForm as Object Public Sub New() MyBase.New() InitializeComponent() End Sub Public Sub New(ByRef CallingForm as Object) 'New Constructor Note the addition of a variable MyBase.New() InitializeComponent() 'After initialization do this me._CallingForm = CallingForm End Sub
Constructors are a fairly fundamental part of object oriented programming. Read this explanation of their usage on the MSDN library: http://msdn.microsoft.com/library/de...Guidelines.asp