Results 1 to 4 of 4

Thread: Making a new startup form by clicking

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    278

    Making a new startup form by clicking

    Ok, I want my program so that it has a form that loads up when the app runs but if the user clicks a certain cmdbutton then a different form will load up everytime the App is run. How do i do this?
    "Whether you think you can or cannot, you are always right."

  2. #2
    Lively Member
    Join Date
    Nov 2002
    Location
    Albacete, Spain
    Posts
    71
    Hi BorT. What you want to do would be very easy if you save the name of the form in an INI file. You may save this value when the user clicks that Command Button, and read it from the INI file when your application starts.

    You can do this by using the API functions called: WritePrivateProfileString, and GetPrivateProfileString... I'm not sure if their names are exactly that ones. If you can't find them, let me know and I'll search.

    Does it help you?

  3. #3
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    You could check a registry setting, and, if it's set to, say, 1, then you'd load the second form. Otherwise, you'd load the first form. You could set the value to 1 when the command button is pressed and check it when your program is opening (you'd probably want to use Sub Main instead of a form load then). Here's a link for using GetSetting and SaveSetting:

    From MartinLiss's signature: http://www.vbforums.com/showthread.p...hreadid=232113
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  4. #4

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