Results 1 to 3 of 3

Thread: setting dialogresult as dialogresult.ok

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    setting dialogresult as dialogresult.ok

    i have created a form and now i want to instanciate it. i do it and then call it as ShowDialog() and i want to catch if it returns dialogresult.ok or dialogresult.cancel...now in the form how do i do it? i tried putting the a command button as a AcceptButton but it still doesnt seem to work..what is the problem?
    \m/\m/

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Set the button's DialogResult property to ok or whatever you want. Then do this
    VB Code:
    1. Dim myForm As New Form1
    2. If(myForm.ShowDialog() = DialogResult.Ok) Then
    3.      MessageBox.Show("Ok button pressed")
    4. End If

  3. #3

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ahok tks
    \m/\m/

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