473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Form on top of Main form???

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
2 1471
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kiteman - Canada | last post by:
Is there an event triggered when a form is dragged by its titlebar? I have two forms on screen - the main form is draggable and I need the secondary form to automatically reposition itself...
5
by: ChrisR | last post by:
Hi all Ive have a Main Form with Command Buttons down the Left hand side, that open various forms. Clicking on a button opens a Sub Form which is moved to take up 3/4s of the right of the main...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
5
by: Lyn | last post by:
Hi, I hope someone can help. I have a main form which mostly fills the Access window. In the bottom half of this form I have a tab control to display various types of data related to the main...
6
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
2
by: Legendary Pansy | last post by:
Hello, I'm trying to accomplish the impossible by trying to do something equivalent of this example found here http://www.c-sharpcorner.com/Code/2003/Dec/DialogTutorial.as Starting with "Listing...
3
by: gsb58 | last post by:
Hi! A mainform is being used to show records from a table in an sql database. A button on the main form will load a new form that allows the user to add, delete, update and search certain...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
6
by: Thom Little | last post by:
Using C# 3.5 I have a form that calls many other sub-forms. Typically there will be five forms open at the same time. If the main form is closed all the sub forms are also closed. Is there...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.