?
Solved

return value from one C# winform

Posted on 2011-09-08
3
Medium Priority
?
574 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
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 …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

777 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