|
-
Nov 17th, 2000, 11:39 AM
#1
Thread Starter
Fanatic Member
Hi!
Does any 1 know how I can reference the startup form
in a project via code...
(If you go into your project's properties, click on the
General tab, and StartUp Object...)
Thanks in advance..
-
Nov 17th, 2000, 11:44 AM
#2
Junior Member
startup form
im not sure that this will work, but a simple way would be to set it as a variable first. Im not sure if this is what you are asking, but you could just define a global variable frmStartUpForm as Form.
and just put frmStartUpForm = form1.(form?)
i dont knoe if you need the form at the ened but hey you might. ive never had the need to do this but that will probably work
and then when you want to activate it just do frmStartUpForm.show. or load frmStartUpForm i think may work also, but you may have to tweak the code some to get it to work.
-
Nov 17th, 2000, 11:48 AM
#3
Thread Starter
Fanatic Member
..
I am not supposed to know what it is
I am supposed to look into that area and find out what is there and use it...
Thanks in advance
-
Nov 17th, 2000, 01:34 PM
#4
Hyperactive Member
I'm assuming that at the point where the program needs to know this, the project file will exist on disk. If it's just the exe, you should have known the startup object when you made the exe.
Open the *.vbp file for input, and read in 1 line at a time. Look for:
Startup="Sub Main"
and take everything after the =, then strip the quotes.
-
Nov 17th, 2000, 01:41 PM
#5
Thread Starter
Fanatic Member
!!!!
jmc.....Thanks...
Now, If I can take that string and turn into an object
so that I can do, say, (mine being a form)
frmOne.something
I'd be all set
-
Nov 17th, 2000, 01:48 PM
#6
Hyperactive Member
You can, but only if the form is loaded:
Code:
Dim strForm As String
Dim frm As Form
strForm = "frmMain"
For Each frm In Forms
If frm.Name = strForm Then Exit For
Next
Debug.Print frm.Caption
Set frm = Nothing
-
Nov 17th, 2000, 02:01 PM
#7
Thread Starter
Fanatic Member
...
Very gut.... my friend
Thanks
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
|