Results 1 to 2 of 2

Thread: Paint Program Questions...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Posts
    3

    Post

    I'm developing a paint program. I'm having a difficulty getting one thing implemented. That's loading an image to the size specified by the user.

    Here's what I did...

    When the user clicks on mnuNew in the menu or New in the Toolbar, the program loads a New File Properties window, which lets the user type in the image size and background color. Here's the code I put in...

    Private Sub cmdOk_Click()
    CheckWidth
    CheckHeight
    ContinueLoading
    End Sub

    Private Sub CheckWidth()

    If txtWidth.Text <= 0 Then
    MsgBox "Width must be greater than zero."
    End If
    End Sub

    Private Sub CheckHeight()

    If txtHeight.Text <= 0 Then
    MsgBox "Height must be greater than zero."
    End If
    End Sub


    Private Sub ContinueLoading()

    Unload Me

    Static lDocumentCount As Long
    Dim frmD As frmDocument
    lDocumentCount = lDocumentCount + 1
    Set frmD = New frmDocument
    frmD.Caption = "Document " & lDocumentCount
    frmD.Show
    frmMain.HScroll1.Enabled = True

    End Sub

    Ok, so one problem I have is that I don't know how to make the size of the new picBoard be the size specified by the user (in pixels), and another is that if the user types in a number less or equal to 0, then a message box pops up telling the user that the number must be greater than zero, but the new document still loads after the user clicks ok on that message box.

    Please help me out, thx.

    -Simon B.


  2. #2
    Hyperactive Member
    Join Date
    Sep 1999
    Posts
    305

    Post

    The solution for the second part is to go back to the part where you ask for the dimensions. Put a line right after the msgbox that goes back to the box for inputing the dimensions. What's wrong now is that is says it's wrong and continues on the code. You have to tell it to go back if there's an error. Can't help you with the other one though.

    ------------------

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