Results 1 to 4 of 4

Thread: [RESOLVED] Message Box "MsgBox" question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    322

    Resolved [RESOLVED] Message Box "MsgBox" question

    I want to use a MsgBox in my project and have a little problem.I use the picture box in order to calculate the values from the picture that load on it.I want to put a message box so if there no picture loaded on the picturebox should get an apropriate message.

    Code
    If Picture1.Picture = False Then
    MsgBox("Select Picture"), vbOKOnly
    End If

    The problem is that when i push the button the rest of the program is running and i still calculate the picture values with a loop.How can i change it so if there is no picture loaded and i push the ok button i should be able to start and select a picture (with a button i created on the main menu ) to load.Any ideas???

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Message Box "MsgBox" question

    VB Code:
    1. Private Sub Command1_Click()
    2. If Picture1.Picture = 0 Then
    3. MsgBox "Select Picture"
    4. Exit Sub 'For Closing the Command button Event
    5. End If
    6. End Sub
    Last edited by shakti5385; Oct 26th, 2006 at 08:21 AM.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Message Box "MsgBox" question

    VB Code:
    1. If Picture1.Picture = False Then
    2.      MsgBox("Select Picture"), vbOKOnly
    3.      Exit Sub '<===== insert this line
    4. End If

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    322

    Re: Message Box "MsgBox" question

    Thank's a lot!!!

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