|
-
Oct 1st, 2000, 11:21 AM
#1
Thread Starter
New Member
I am working on my first VB application for a friend with his own business. When the user enters an item (ie. part #, Customer, etc.)that is not in the database he is taken to the setup screen for that item. My problem is how to get him back to his original screen and location after the setup is complete. He may not always be in the same form when he has a need to setup a new item so the form I have to get back to may change.
-
Oct 1st, 2000, 11:38 AM
#2
Addicted Member
Hi,
Instead of completely swithcing forms to enter a new customers details, just show the setup screen as a modal form for the calling form. That way, once the setup is finished with it will automatically go back to screen that called it.
example:
Code:
'say you have two forms and one set up form and either form can call the set up form
'In form1 code where you need to show setup screen
SetupScreen.Show vbModal,Form1
'In form2 code where you need to show setup screen
SetupScreen.Show vbModal,Form2
'Once the set up screen is finished, you will go back to the calling form exactly where you left it
Hope this helps
Shaun
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Oct 1st, 2000, 03:28 PM
#3
First, add this to the beginning of the module that opens the Setup Screen.
Code:
Public Declare Function GetActiveWindow Lib "user32" _
Alias "GetActiveWindow" () As Long
Public Declare Function SetForegroundWindow Lib "user32" _
Alias "SetForegroundWindow" (ByVal hwnd As Long) As Long
Public winact as Long
Then, add this to the beginning of the procedure that opens the dialog:
Code:
winact = GetActiveWindow
And add this to the end of setup program:
Code:
SetForegroundWindow winact
Hope it helps.
-
Oct 1st, 2000, 03:30 PM
#4
S@NSIS:
If you show the form as Modal, then no other forms can be on top of it. If you're a beginner and need to close a background window...
-
Oct 1st, 2000, 05:28 PM
#5
Lively Member
FORM IN THE BACKGROUND, NOT ON TOP!
Escaflowne,
Is there a way to force a form to stay in the back
instead of on top?!
0101011001000010
01101111011011100110110001101001011011100110010101110010
-
Oct 1st, 2000, 06:23 PM
#6
If they're all in the same Thread/App, use
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|