Results 1 to 3 of 3

Thread: [RESOLVED] User input

  1. #1

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Resolved [RESOLVED] User input

    This should be simple. I can create an situation where the user has to input data. No problem. However, I am having a problem figuring out how to do s imple message box with a yes/no button configuration. I can't find an example in any of my manuals.

    VB6 code:

    Dim PRINTREPLY As VbMsgBoxResult
    PRINTREPLY = MsgBox("Print to screen?", vbYesNo)
    If PRINTREPLY = vbNo Then
    glbPrinterDestination = 1
    Else
    glbPrinterDestination = 0
    End If

    That is the kind of thing I am looking to do.
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  2. #2

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: User input

    This seems to work:

    Dim drClear As MsgBoxResult

    drClear = MsgBox("Do you really want to clear the scans?", MsgBoxStyle.YesNo, "Clear scans confirmation")

    If drClear = MsgBoxResult.Yes Then

    Dim appFullPath As String = appPath '& appFile

    System.IO.File.Delete(appFullPath)
    Dim file As System.IO.FileStream
    file = System.IO.File.Create(appFullPath)
    file.Close()
    objReader = New StreamReader(appFullPath)
    objReader.Close()
    MessageBox.Show("Scan file cleared")
    End If
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  3. #3
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: [RESOLVED] User input

    Hi,
    msgbox is retained for VB6 compatibility - take a look at Messagebox.Show instead

    Pete
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

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