Results 1 to 8 of 8

Thread: Show this form at startup

  1. #1

    Thread Starter
    Addicted Member ajames's Avatar
    Join Date
    Mar 2005
    Location
    Wales, UK
    Posts
    178

    Show this form at startup

    Using a check box called checkbtn1, how would I make the form it is on show at startup if the check box is checked?

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Show this form at startup

    I don't understand. If the checkbox is on the form that you don't want to show at startup, then how could they get it back? You could store the choice in the registry and check the value to see whether the form should be shown at startup.
    Last edited by dglienna; Sep 4th, 2005 at 01:22 PM.

  3. #3

    Thread Starter
    Addicted Member ajames's Avatar
    Join Date
    Mar 2005
    Location
    Wales, UK
    Posts
    178

    Re: Show this form at startup

    It's a form that the user can access via the "help" menu. It's just a complicated help file, thats all.

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Show this form at startup

    You can save settings like this:

    VB Code:
    1. Private Sub Form_Unload(Cancel As Integer)
    2.    SaveSetting "RegCust", "Startup", "Backup", strDate
    3.    SaveSetting "RegCust", "Startup", "LastEntry", _
    4.    intLastEntry
    5. End Sub

    and then use this to get the info back

    GetSetting Function


    Returns a key setting value from an application's entry in the Windowsregistry.

    Syntax

    GetSetting(appname, section, key[, default])

    The GetSetting function syntax has thesenamed arguments:

    Part Description
    appname Required.String expression containing the name of the application or project whose key setting is requested.
    section Required. String expression containing the name of the section where the key setting is found.
    key Required. String expression containing the name of the key setting to return.
    default Optional.Expression containing the value to return if no value is set in the key setting. If omitted, default is assumed to be a zero-length string ("").


    Remarks

    If any of the items named in the GetSetting arguments do not exist, GetSetting returns the value of default.

  5. #5

    Thread Starter
    Addicted Member ajames's Avatar
    Join Date
    Mar 2005
    Location
    Wales, UK
    Posts
    178

    Re: Show this form at startup

    I dont get it. Where does the checkbox thing come in?

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Show this form at startup

    Print the value of the checkbox into the registry when you unload the app, and then read it in before you show the form, to see if it should show or skip the form.

  7. #7

    Thread Starter
    Addicted Member ajames's Avatar
    Join Date
    Mar 2005
    Location
    Wales, UK
    Posts
    178

    Re: Show this form at startup

    where does the checkbox value go?

  8. #8
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Show this form at startup

    This should be what you need.

    VB Code:
    1. Private Sub Form_Unload(Cancel As Integer)
    2.    dim cVal as Boolean
    3.    If check1.value= vbChecked then
    4.       cVal = True ' Show the form next time
    5.    Else
    6.       cVal = False ' Don't show the form on StartUp
    7.    Endif
    8.    SaveSetting "MyApp", "Startup", "HelpForm", cVal
    9. End Sub

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