Need some Simple Help knowing when a form is accepted???????????

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Suzanna

    #1

    Need some Simple Help knowing when a form is accepted???????????

    Hi Guys,

    I am trying to use the below code to open a messgae box when the OK
    button is clicked on a dialog form. Its not working though.

    The dialogue form is a separate form with just a single OK button
    attached. I have set the dialogaccept to OK on the button etc.

    Private Sub RenameToolStrip MenuItem_Click( ByVal sender As
    System.Object, ByVal e As System.EventArg s) Handles
    RenameToolStrip MenuItem.Click
    Dialog1.Show()
    Dialog1.Locatio n = ContextMenuStri p1.SourceContro l.Location
    If Dialog1.DialogR esult = Windows.Forms.D ialogResult.OK Then
    MsgBox("hhh")
    End If

    End Sub

  • Ken Tucker [MVP]

    #2
    Re: Need some Simple Help knowing when a form is accepted??????? ????

    Hi,

    Use showdialog to show the form to get a resultback

    Dim dr as DialogResult = Dialog1.ShowDia log()
    Dialog1.Locatio n = ContextMenuStri p1.SourceContro l.Location
    If dr = Windows.Forms.D ialogResult.OK Then
    MsgBox("hhh")
    End If

    Ken
    --------------------------
    "Suzanna" <marc_crosby@ho tmail.comwrote in message
    news:1165091707 .387310.161970@ j72g2000cwa.goo glegroups.com.. .
    Hi Guys,
    >
    I am trying to use the below code to open a messgae box when the OK
    button is clicked on a dialog form. Its not working though.
    >
    The dialogue form is a separate form with just a single OK button
    attached. I have set the dialogaccept to OK on the button etc.
    >
    Private Sub RenameToolStrip MenuItem_Click( ByVal sender As
    System.Object, ByVal e As System.EventArg s) Handles
    RenameToolStrip MenuItem.Click
    Dialog1.Show()
    Dialog1.Locatio n = ContextMenuStri p1.SourceContro l.Location
    If Dialog1.DialogR esult = Windows.Forms.D ialogResult.OK Then
    MsgBox("hhh")
    End If
    >
    End Sub
    >

    Comment

    • Suzanna

      #3
      Re: Need some Simple Help knowing when a form is accepted??????? ????

      Great that worked...thank you very much
      Ken Tucker [MVP] wrote:
      Hi,
      >
      Use showdialog to show the form to get a resultback
      >
      Dim dr as DialogResult = Dialog1.ShowDia log()
      Dialog1.Locatio n = ContextMenuStri p1.SourceContro l.Location
      If dr = Windows.Forms.D ialogResult.OK Then
      MsgBox("hhh")
      End If
      >
      Ken
      --------------------------
      "Suzanna" <marc_crosby@ho tmail.comwrote in message
      news:1165091707 .387310.161970@ j72g2000cwa.goo glegroups.com.. .
      Hi Guys,

      I am trying to use the below code to open a messgae box when the OK
      button is clicked on a dialog form. Its not working though.

      The dialogue form is a separate form with just a single OK button
      attached. I have set the dialogaccept to OK on the button etc.

      Private Sub RenameToolStrip MenuItem_Click( ByVal sender As
      System.Object, ByVal e As System.EventArg s) Handles
      RenameToolStrip MenuItem.Click
      Dialog1.Show()
      Dialog1.Locatio n = ContextMenuStri p1.SourceContro l.Location
      If Dialog1.DialogR esult = Windows.Forms.D ialogResult.OK Then
      MsgBox("hhh")
      End If

      End Sub

      Comment

      Working...