in VB.net app how to show a modeless form when a model form show.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a list form and a detail form .

Before, I open the List form, use form.showDialog(),then I click List Item
and open the Detail Form by form.show().

now , user need when the list form show, auto open the first Item Detail .

I add detail form.show() in list form.form_load event , but problem.

some idea?? help me
 
yzi,

Can you show a piece of code there are thousands of possibilities to show
forms

Cor
 
like this
'' Module1.vb
.........
Public Sub main()

Dim frm As New Form1
frm.ShowDialog()
End Sub
.........

'' Form1.vb
..........
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim frm As New Form2
frm.Show()

End Sub
............

Form2.vb
...............
...............

I need Form1 and Form2 all working.
 
Yzi,

When you delete this part

\\\\
'' Module1.vb
........
Public Sub main()

Dim frm As New Form1
frm.ShowDialog()
End Sub
........
///
And set in the solution properties the startup back to form1.

Than they both are active,

And although I find it not the best way to go, you can to learn create in
form2

Public frm1 as form

And in form1
'' Form1.vb private frm2 as Form2
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
frm2 = New Form2
frm2.Frm1 = me
frm2.Show()

End Sub
...........

You can than even communicatie between the two

In form1 is form2 than frm2
In form2 is form1 than frm1

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top