Results 1 to 12 of 12

Thread: [RESOLVED] Specify which form opens first

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington DC
    Posts
    314

    Resolved [RESOLVED] Specify which form opens first

    VB5.0

    When I open a project, sometimes it opens to the forum layout window or to some form or module where I am not working lately.

    I would expect if I am working on Form2 and save project and later return, Form2 would be open, not Form4 or module2 or the layout window, etc.

    Is there any way I can specify the default open place.

    Mac

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Specify which form opens first

    If you save your project,close VB and than reopen the project, the IDE should open the project as it was saved (at least as far as I understand it)
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Specify which form opens first

    Quote Originally Posted by opus
    If you save your project,close VB and than reopen the project, the IDE should open the project as it was saved (at least as far as I understand it)
    If he were using VB6 I would agree, but I don't know (or at least can't remember) how VB5 handled it. Theoretically, it should work the same way.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington DC
    Posts
    314

    Re: Specify which form opens first

    Yo, Hack,

    I guess that is why they went to VB6 (LOL).

    Saving does not help. I keep coming back to the same form no matter what.

    I was wishing for some VB5 person to say "edit project.vbp using notepad and find variable starthere= and change the number shown" (or some trick like that).

    Anyway, I will leave this open for a while in case a VB5-guru comes along.

    Question: your "save ana" signature talks about "highlight=vb". I never heard of that. I use code, /code like it is done on all forums I ever saw.

    Am I doing it wrong? If so, what is the difference? Thanks - Mac

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Specify which form opens first

    Quote Originally Posted by Mr.Mac
    I was wishing for some VB5 person to say "edit project.vbp using notepad and find variable starthere= and change the number shown" (or some trick like that).
    Actually, that is not a bad idea. You could try messing around with that. My vbp file is empty because as soon as I create a project, I open that, delete everything, and then make it read only. That way, when I open a project, nothing is open and I can chose what I want from my project explorer. But, that is a personal preference. You might be able to do something along those lines.
    Quote Originally Posted by Mr.Mac
    Question: your "save ana" signature talks about "highlight=vb". I never heard of that. I use code, /code like it is done on all forums I ever saw.

    Am I doing it wrong? If so, what is the difference? Thanks - Mac
    You may remember the [vbcode]code here[/vbcode] tags. That was a forum add in that got whacked during our last upgrade.

    They were replaced with the [highlight=vb]your code goes in here[/highlight] tags. These highlight tags work for: VB, SQL, C, PHP and others. Unlike the [code]your code goes here[/code] tags, the highlight tags do syntax highlighting. The bad part is that code posted with them is a mess to try and copy, so by in large, everyone uses the [code]your code goes here[/code] tags.

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Specify which form opens first

    It's not project.vbp you need to worry about, it is the project.vbw - the WorkSpace file, which should be in the same folder as the vbp.

    This file specifies which windows are shown (and which one of them is active) when you next open the project.

    It should automatically get updated whenever you save the Project (but not if you save individual forms etc).

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington DC
    Posts
    314

    Re: Specify which form opens first

    Thanks - I will examine that file later

    By the way, please explain in great detail how to put the RESOLVED flag on a thread. I have seen cryptic hints about some pulldown list, but I simply can't find it. Is it at the right-top, bottom-left. Do I need scripting enabled in order to see it? What exact words would I look for?

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Specify which form opens first

    You probably do need scripting enabled, but I'm not sure..

    Just above the first post in the thread (here) there should be a few text links, including "Thread Tools".

    When you click on it, there should be a drop-down list which includes "mark thread resolved".

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington DC
    Posts
    314

    Re: Specify which form opens first

    Quote Originally Posted by si_the_geek
    You probably do need scripting enabled
    That was the ticket! I had tried "Thread Tools" before, but there were only four items (unsubscribe, etc.) - i.e. no "mark thread resolved".

    When I enabled scripting, the "Thread Tools" area even included a new button to get the dropdown list immediately instead of creating a new table in the page as it did when I clicked on the no-script button.

    Thanks. I never allow scripting except in special cases, so I guess my procedure will be
    1) Get out of the browser (IE - I like it, but it has security problems)
    2) Click on my program that allows scripting, etc. via a registry update
    3) Get back in IE and Resolve the thread
    4) Get out of IE again
    5) My program 2 is still running, waiting for me to say I'm finished.
    6) Say it to restore security and terminate that program.

    A slight pain, but at least I know how. Many thanks!

    On my forum (QBasic http://www.network54.com/Forum/13959/) all posts have a title which are in an indented-list format and closed posts are known when someone posts *Thanks! (Or "Never mind - I figured out another way" etc.)

    Mac

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington DC
    Posts
    314

    Re: Specify which form opens first

    Quote Originally Posted by si_the_geek
    It's not project.vbp you need to worry about, it is the project.vbw - the WorkSpace file, which should be in the same folder as the vbp.
    Rats!

    I opened N54URL.vbw in NOTEPAD and saw
    Form1 = 110, 110, 509, 482, Z, 22, 22, 421, 394,
    Module1 = 154, 154, 553, 526,
    Form2 = 88, 88, 487, 460, , 66, 66, 465, 438,
    Form3 = 154, 154, 553, 526, , 0, 0, 399, 372,

    Ah-hah! I thought. Form3 is what always opens. So I saved this
    Form2 = 88, 88, 487, 460, , 66, 66, 465, 438,
    Form3 = 154, 154, 553, 526, Z, 0, 0, 399, 372,
    Module1 = 154, 154, 553, 526,
    Form1 = 110, 110, 509, 482, , 22, 22, 421, 394,

    (and double checked)

    Do you believe that when I opened the project, stupid Form3 was still the default?

    In addition, although I made no changes and exited without save, the vbw file was restored to the original.

    But on a hunch, I looked into VBP and found a list of modules at the top and I moved Form1 to the end and that solved my problem.

    It is a slight pain, but at least it is feasible.

    Say, Hack, I will experiment with your technique just for fun, but my VBP file is chock full of stuff. I don't know whether the program will run without it. Thanks for the hint, though!

    Mac

  11. #11
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Specify which form opens first

    Quote Originally Posted by Mr.Mac
    Say, Hack, I will experiment with your technique just for fun, but my VBP file is chock full of stuff. I don't know whether the program will run without it.
    It will.

    But, to be on the safe side, copy it to a backup folder before messing around with it.

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington DC
    Posts
    314

    Re: Specify which form opens first

    Well, in VB5 you evidently must have some line in the VBP file. When I tried to run with an empty one, I got an error message "EOF reading VBP".

    Anyway, my initial question is resolved: I can control which form is opened by placing it last in the VBP file.

    Thanks all

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width