Sorry, are you saying that in form1 you have two buttons that both open form2, but form2 is supposed to behave differently depending on which button you pressed? If so then you need to think of this slightly differently. form2 doesn't actually care what button is pressed. It only cares what it is told to do. You might want to actiavet the same functionality from a menu item or something else completely unrelated to either button. You need a way to pass an instrcution to this form. The most logical way to do that is through the constrcutor. You write one or more constructors that take parameters that control how the form behaves. If you only have two choices then you might have one argument of type Boolean:You then pass a Boolean value to the form when you create it. The basic button would pass False to the argument and the flash button would pass True.VB Code:
Public Sub New(ByVal flash As Boolean) ' This call is required by the Windows Form Designer. InitializeComponent() ' Add any initialization after the InitializeComponent() call. If flash Then 'Perform a flash search. Else 'Perform a basic search. End If End Sub




Reply With Quote