Solved

return value from one C# winform

Posted on 2011-09-08
3
556 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 74

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 74

Expert Comment

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now