Results 1 to 4 of 4

Thread: [RESOLVED] ending a very small program when its finished processing

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Resolved [RESOLVED] ending a very small program when its finished processing

    Hi all,

    I read up about this somewhere I have a very tiny basic program using the commondialog control. It is bieng called from a shortcut. How can I make it so it automatically closes when its finished. i.e. so the form closes when finished rather than the user having to close it.

    VB Code:
    1. Private Sub Form_Load()
    2. Dim strFile As String
    3.  
    4. On Error Resume Next
    5.  
    6.     With CommonDialog1
    7.         .Flags = cdlOFNExplorer
    8.         .Filter = "Jpg (*.jpg)|*.jpg"
    9.         .InitDir = "C:\"
    10.         .DialogTitle = "Select File"
    11.         .ShowOpen
    12.         If Not .FileName = "" Then
    13.             strFile = Mid(.FileName, InStrRev(.FileName, "\") + 1)
    14.             If Dir(FAVORITES_FOLDER & strFile) = "" Then
    15.                 FileCopy .FileName, FAVORITES_FOLDER & strFile
    16.             End If
    17.         End If
    18.     End With
    19. End Sub


    thanks in advance
    Rob

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: ending a very small program when its finished processing

    VB Code:
    1. End If
    2.         End If
    3.     End With
    4.     Unload Me
    5. End Sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: ending a very small program when its finished processing

    thanks very much indeed. Well appreciated

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: ending a very small program when its finished processing

    Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer. Also if someone has been particularly helpful, or even particularly unhelpful, you have the ability to affect a their forum "reputation" by rating their post.

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