|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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 RenameToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RenameToolStripMenuItem.Click Dialog1.Show() Dialog1.Location = ContextMenuStrip1.SourceControl.Location If Dialog1.DialogResult = Windows.Forms.DialogResult.OK Then MsgBox("hhh") End If End Sub Hi,
Use showdialog to show the form to get a resultback Dim dr as DialogResult = Dialog1.ShowDialog() Dialog1.Location = ContextMenuStrip1.SourceControl.Location If dr = Windows.Forms.DialogResult.OK Then MsgBox("hhh") End If Ken -------------------------- Show quoteHide quote "Suzanna" <marc_cro***@hotmail.com> wrote in message news:1165091707.387310.161970@j72g2000cwa.googlegroups.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 RenameToolStripMenuItem_Click(ByVal sender As > System.Object, ByVal e As System.EventArgs) Handles > RenameToolStripMenuItem.Click > Dialog1.Show() > Dialog1.Location = ContextMenuStrip1.SourceControl.Location > If Dialog1.DialogResult = Windows.Forms.DialogResult.OK Then > MsgBox("hhh") > End If > > End Sub > Great that worked...thank you very much
Ken Tucker [MVP] wrote: Show quoteHide quote > Hi, > > Use showdialog to show the form to get a resultback > > Dim dr as DialogResult = Dialog1.ShowDialog() > Dialog1.Location = ContextMenuStrip1.SourceControl.Location > If dr = Windows.Forms.DialogResult.OK Then > MsgBox("hhh") > End If > > Ken > -------------------------- > "Suzanna" <marc_cro***@hotmail.com> wrote in message > news:1165091707.387310.161970@j72g2000cwa.googlegroups.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 RenameToolStripMenuItem_Click(ByVal sender As > > System.Object, ByVal e As System.EventArgs) Handles > > RenameToolStripMenuItem.Click > > Dialog1.Show() > > Dialog1.Location = ContextMenuStrip1.SourceControl.Location > > If Dialog1.DialogResult = Windows.Forms.DialogResult.OK Then > > MsgBox("hhh") > > End If > > > > End Sub > >
enter key press
best way to learn Windows Forms Merging two tables in Dataset? I only want to get the matching info based on the two key fields Working with a database How to set an objects property using Reflection PIAs for Excel 9.0 Make Code Fail Enter Key vs. Tab Key How Do I Kill Non-Printable Characters? Select All CheckBoxes Drag and Drop controls during runtime in Windows App |
|||||||||||||||||||||||