By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

Form on top of Main form???

P: n/a
I have an in house application which uses 3 different version of the same
database. When application starts a form is displayed which allows user to
provide the path to the database. My problem is I want this form to open on
top of main form. At present the main form doesn’t appears until user press
OK or Cancel on the form where they provide the data path.

I have used Sub Main as startup object as follows

Sub main()
Dim frm As New frmMain
frm.ShowDialog()
End Sub
And called the other on Form Load event of main form as follow

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim frm As New frmSetDatabasePath
frm.ShowDialog(Me)

End Sub

How can I fix this.

Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Job,

When you forget your Sub Main

And let your MainForm be your startup page, than you can archieve what you
want by setting this at the end of your load event of that mainform

\\\
me.show
Dim frm As New frmMain
frm.ShowDialog()
///

Did you know by the way that the
microsoft.public.dotnet.languages.vb newsgroups belongs to the most active
devellopers ones

(Somebody using C# would never do it this way, simple because it is
impossible with C#)

I hope this helps?

Cor
"Job Lot" <Jo****@discussions.microsoft.com>
I have an in house application which uses 3 different version of the same
database. When application starts a form is displayed which allows user to
provide the path to the database. My problem is I want this form to open
on
top of main form. At present the main form doesn't appears until user
press
OK or Cancel on the form where they provide the data path.

I have used Sub Main as startup object as follows

Sub main()
Dim frm As New frmMain
frm.ShowDialog()
End Sub
And called the other on Form Load event of main form as follow

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim frm As New frmSetDatabasePath
frm.ShowDialog(Me)

End Sub

How can I fix this.

Nov 22 '05 #2

P: n/a
1st you load the main form and then in the onload event of main form load
database path form and also make it modal or modeless as ur requirement

"Job Lot" ने लिखा:
I have an in house application which uses 3 different version of the same
database. When application starts a form is displayed which allows user to
provide the path to the database. My problem is I want this form to open on
top of main form. At present the main form doesn’t appears until user press
OK or Cancel on the form where they provide the data path.

I have used Sub Main as startup object as follows

Sub main()
Dim frm As New frmMain
frm.ShowDialog()
End Sub
And called the other on Form Load event of main form as follow

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim frm As New frmSetDatabasePath
frm.ShowDialog(Me)

End Sub

How can I fix this.

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.