jeshra_279
Member
- Joined
- Oct 28, 2009
- Messages
- 6
- Programming Experience
- 3-5
I have 2 forms, main Form1 and a loginform. When I start the application, first "Form1" is loaded and then with a button click, user can load "loginform" if required to enable/disable some features/controls on Form1.
The sequence is like this:
1) Load main form Form1
2) click a button on Form1
3) Load the loginform.
4) enter user/pwd and click OK button
5) enable/disable "GroupBox" control on Form1 if login sucessful.
For this,
I made a click event for OK button in loginform, so once user clicks the OK button, I want to call one function which is defined in Form1 as a Public, which enables/disables the "GroupBox" control on Form1. The code structure is like this:
in main Form1, i created a function like this:
Class Form1()
Public Function DoThis() ' Function to enable/disable GroupBox control
....some task...
End Function
End
now in loginform, in the click event for OK button:
Class loginform()
Click_OK()
{
DoThis().... 'call function DoThis() of Form1
}
End
I am not able to call the DoThis() function in loginform. Please suggest me with a piece of code how to do this??
Please remember that Form1 is my main form which is loading first. If anyother way is there to make a password protected feature for GroupBox control in Form1, it will be highly appriciated.
Hope my problem is clear..Thanks.
The sequence is like this:
1) Load main form Form1
2) click a button on Form1
3) Load the loginform.
4) enter user/pwd and click OK button
5) enable/disable "GroupBox" control on Form1 if login sucessful.
For this,
I made a click event for OK button in loginform, so once user clicks the OK button, I want to call one function which is defined in Form1 as a Public, which enables/disables the "GroupBox" control on Form1. The code structure is like this:
in main Form1, i created a function like this:
Class Form1()
Public Function DoThis() ' Function to enable/disable GroupBox control
....some task...
End Function
End
now in loginform, in the click event for OK button:
Class loginform()
Click_OK()
{
DoThis().... 'call function DoThis() of Form1
}
End
I am not able to call the DoThis() function in loginform. Please suggest me with a piece of code how to do this??
Please remember that Form1 is my main form which is loading first. If anyother way is there to make a password protected feature for GroupBox control in Form1, it will be highly appriciated.
Hope my problem is clear..Thanks.