?
Solved

return value from one C# winform

Posted on 2011-09-08
3
Medium Priority
?
580 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 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

850 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