Solved

return value from one C# winform

Posted on 2011-09-08
3
569 Views
Last Modified: 2013-12-17
I have one dll made by C# winform. I added a new form in that dll with two buttons, 1. OK 2. Cancel.

In this situation the form can return 3 values.
1. Cancelled (Cancel button)
2. Success (From OK button)
3. Failure (From OK button)

I want to give that dll to other developers. They will work in their codes based on the three values mentioned above.

My question is, how to return these three values from the dll?

My dll code pattern is given below:
----------------------------------------------

class <dll name>
{
        function 1
        {
        }
        method 1
         {
         }
        function 2
        {
        }
        method 2
         {
               frmAbc fmAbc=new frmAbc     //this is my form i introduced in that dll
         }
}

class <form name>
{
      private <ok button click event>
      private <cancel button click event>
}
0
Comment
Question by:Amitava_Mukherjee
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 36508000
Use the DialogResult member. Then your 3rd-party users can either reference that member directly, or they can use it by means of a call to ShowDialog. For more info: http://msdn.microsoft.com/en-us/library/system.windows.forms.form.dialogresult.aspx
0
 

Author Closing Comment

by:Amitava_Mukherjee
ID: 36508014
Thanx, done
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36508019
NP. Glad to help  = )
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vb.net threads keep increasing 2 50
Need to sort columns in DataGridView 4 38
Coding for the first time 9 70
Need help with another query 10 39
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question