473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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

Dec 2 '06 #1
2 839
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" <ma*********@hotmail.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.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
Dec 2 '06 #2
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.ShowDialog()
Dialog1.Location = ContextMenuStrip1.SourceControl.Location
If dr = Windows.Forms.DialogResult.OK Then
MsgBox("hhh")
End If

Ken
--------------------------
"Suzanna" <ma*********@hotmail.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.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
Dec 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
11
by: charlie_M | last post by:
I have a number of applications where I want to have many onclick='submit()' attached to different 'elements' on a single form ..... which sends the form to a CGI "script" which does all the...
3
by: Andrew | last post by:
What I have right now is a list of potential clients for my agency in report form. They are inputted through a basic form and then shown on our Intranet via a DAP. What I need is some way to...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
3
by: Bob C. | last post by:
When I migrated my tables to SQL Server I needed a way to overcome the slow performance of the Find method on my recordsets. Although this can be done by accessing the table directly using dao and...
2
by: iwdu15 | last post by:
hey, i was wondering if 1) anyone could tell me whats wrong with my code, i did a little fixing to the msdn version fo this, or 2) how to make a simple program that will connect and listen for...
9
by: ILCSP | last post by:
Hello, perhaps you guys have heard this before in the past, but here is what I'm looking for. I have a SQL 2000 table with Social security numbers. We need to create a Member ID using the...
14
by: bcap | last post by:
Hello, I really would apprciate help! =) What I want to do is be able to change the status of mulitple records using a drop down and a checkbox. I have a drop down called "ChangeStatus"...
1
by: deepaks85 | last post by:
Dear All, I want to send some data through a form with Multiple attachment in an HTML Format. I have tried it but it is not working for me. I am able to send data without attachment but with the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.