I have a problem in my window project. I want to make a dashboard on the runtime. On login the user firstly it checks all the permission that those form he can open it.The main problem is that he will get a dashboard with some button named according to the permitted form. On click button that form will be displayed. How to open a form on the runtime?. How can i do this? Please help me.
I want to know it for the windows application not for Asp.net
Thanks
Sanjay Kumar Gupta
Mahesh ChandPosted Sep 12, 2010, 10:41 PM
Let's say, you have three employee types - Managers, Sales Reps, and Programmers. So you are going to create three group of controls placed on three different Forms say ManagerForm, SalesRepForm and ProgrammerForm. On these forms, you can place these controls. And you can even hardcode Forms based on user type. If a Manager logs in, you create and open ManagerForm dynamically. You can do that what Suthish had shown in the sample. So on your first form (MainForm or LoginForm), as soon user logs in, you check if a user is Manager, you create an instance of ManagerForm and show it using Show method.
krishna vPosted Sep 12, 2010, 7:18 PM
Suthish NairPosted Sep 7, 2010, 3:33 AM
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myForm As New Form2
myForm.Show()
End Sub