It may sound silly but I really need help. I am just a beginner in vb .net. I am now developing a window-based software.
This is the problem:
1. After the user log-in, the system must show the parent form and automatically show the main transaction form base on the user role or user accessibility in my system manager. Is it possible to do this?

2. In my menulist, I need to recognize which menulist.item is selected. So, I need to bold the letter of the selected menulist.item or underline the word. How can I do this? Any idea? Note: My menulist.item is from my system manager database.

Is this for the login?
What I do is on the load event of the main form I open the Login form as a dialog:

sub Form1_Load()

dim frmLogin as new LoginForm 'what ever you have called your login form..


if you've already got the login form handling the user validation, then when it fails, get it to close itself and the app:

Remember to set your projects starting form to the main form...

Thank you for your response but NO. I already done those snippets in my parent form load. All I need to do is try to load another form after the parent form load.For example, the user who login has a role as an assessors. So, after the user login, the system must show the parent form and the main transaction form of the user with a role as an assessor. Any idea?

OK thats easy enough you do your login, check the user, flag the role they have and if it is an assessor open the form.

dim Assessor as Boolean


If Assessor = true then
  dim Myform as New AssessorForm
Else ...

End if

If I do this in my parent form load, the AssessorForm will show first without the parent form. How to show the two form simultaneously?Is it possible to load two form simultaneously?


You are probably going to have to you the MDI properties to assign one form as the parent and the other as the child:

On your main form load event:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  dim Assessor as Boolean

   Me.IsMdiContainer = True
   If Assessor = true then  
     dim MyForm as New AssessorForm  
     MyForm.MdiParent = Me
   End if

This should open your assessor form as a child of your main parent form.

Thanks for your help but I figured it out by myself. All I need to do is set the child form to view in the top most.

This is the code I write in my parent load:

private sub Parent_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 Dim frm As new childForm
frm.TopMost = true
End Sub

Then viola! the two form shows as what I expected.

Be a part of the DaniWeb community

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