Solved

return value from one C# winform

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

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