Results 1 to 4 of 4

Thread: Freeze all action... [Fixed, thank you very much]

  1. #1

    Thread Starter
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692

    Freeze all action... [Fixed, thank you very much]

    Hey guys, does anyone know how to make it to where you can't click on anything while a certain action is being performed?
    Last edited by hothead; May 8th, 2007 at 08:43 PM.

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: Freeze all action...

    You could create a form that is a "please wait" type form, that you show modally, so nothing but the please wait form can be clicked on.

  3. #3

    Thread Starter
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692

    Re: Freeze all action...

    Umm, that freezes the entire application, hence my code never executes.

    Code:
    Me.MousePointer = vbHourglass
        WaitForm.Show vbModal, Me  'Me = my calling form, MainForm.
        Me.SetFocus
        ToField.Text = ""
        ToField.Locked = True
        ToField.BackColor = vbGray
        SubjectField.Text = ""
        SubjectField.Locked = True
        SubjectField.BackColor = vbGray
        EmailBody.Text = ""
        If ServerAddress.Text = "" Or Username.Text = "" Or Password.Text = "" Then
            MsgBox "You haven't given all the required login information.", vbInformation, "Missing Information"
            Exit Sub
        End If
        StatusCheck.Panels(1).Text = "Attempting to log in..."
        FreePOP1.POPHostname = ServerAddress.Text
        FreePOP1.POPUsername = Username.Text
        FreePOP1.POPPassword = Password.Text
        FreePOP1.Connect
        If Not FreePOP1.ErrorText = "" Then
            GoTo ErrorHandler
        Else
            StatusCheck.Panels(1).Text = "Success, checking for new messages..."
        End If
        If FreePOP1.MsgCount > 0 Then
            For i = 1 To FreePOP1.MsgCount
                FreePOP1.SetCurrentMsg i
                StatusCheck.Panels(1).Text = "Retrieving messages, please wait..."
                With EmailHistory
                    .ListItems.Add , , FreePOP1.MsgFrom
                    .ListItems(i).SubItems(1) = FreePOP1.MsgSubject
                    .ListItems(i).SubItems(2) = FreePOP1.MsgDate
                End With
            Next i
            StatusCheck.Panels(1).Text = FreePOP1.MsgCount & " new messages, waiting for new commands..."
        Else
            StatusCheck.Panels(1).Text = "No new messages"
        End If
        FreePOP1.Disconnect
        Me.MousePointer = vbArrow
        Unload WaitForm
        Exit Sub
    ErrorHandler:
        Select Case FreePOP1.Error
            Case 14
                MsgBox "There was a problem connecting to the server." & vbCrLf & "Either your username or password is incorrect.", vbCritical, "Error connecting to server"
            Case 15
                MsgBox "There was a problem connecting to the server." & vbCrLf & "Either your username or password is incorrect.", vbCritical, "Error connecting to server"
            Case Else
                MsgBox "Error #" & FreePOP1.Error & ":  " & FreePOP1.ErrorText, vbCritical, "Error"
        End Select
        StatusCheck.Panels(1).Text = "There was an error on the last attempt... #" & FreePOP1.Error & ":  " & FreePOP1.ErrorText & "."
        Me.MousePointer = vbArrow
    Last edited by hothead; May 8th, 2007 at 08:25 PM.

  4. #4

    Thread Starter
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692

    Re: Freeze all action...

    Nevermind, I got it. I found I could use a variable to check if the program is busy.

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