Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
AnswerRe: is problem in dataset? Pin
Pankaj - Joshi15-Nov-07 23:18
Pankaj - Joshi15-Nov-07 23:18 
GeneralRe: is problem in dataset? Pin
pekhaleyogesh15-Nov-07 23:26
pekhaleyogesh15-Nov-07 23:26 
GeneralRe: is problem in dataset? Pin
Pankaj - Joshi15-Nov-07 23:37
Pankaj - Joshi15-Nov-07 23:37 
QuestionHow to only open one instance of a window form from parent form Pin
Deques15-Nov-07 22:58
Deques15-Nov-07 22:58 
AnswerRe: How to only open one instance of a window form from parent form Pin
Pankaj - Joshi15-Nov-07 23:15
Pankaj - Joshi15-Nov-07 23:15 
GeneralRe: How to only open one instance of a window form from parent form Pin
Pete O'Hanlon15-Nov-07 23:32
mvePete O'Hanlon15-Nov-07 23:32 
GeneralRe: How to only open one instance of a window form from parent form Pin
Pankaj - Joshi15-Nov-07 23:34
Pankaj - Joshi15-Nov-07 23:34 
GeneralRe: How to only open one instance of a window form from parent form Pin
Bekjong16-Nov-07 0:10
Bekjong16-Nov-07 0:10 
I'd just create a central form pool somewhere and use id's to fetch the form I want. Example:

<font><font>   public class FormpoolClass
    {
        private Dictionary< string, Form > formPool = new Dictionary< string, form=>();

        public class CustomForm : Form
        {

        }

        public formType GetForm<formType>(string form_id) where formType : Form
        {
            if (this.formPool.ContainsKey(form_id))             // check out if we have a reference to the form
            {
                if (formPool[form_id] != null && !formPool[form_id].IsDisposed)
                    return formPool[form_id] as formType;            // if so, return it
                else formPool.Remove(form_id);
            }

            formType ret = null;
            try
            {
                ret = Activator.CreateInstance<formType>();     // not there, so create it
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

            Debug.Assert(ret != null);
            return ret;
        }
    }

    public class Test
    {
        public void dotest()
        {
            FormpoolClass fpc = new FormpoolClass();
            CustomForm f = fpc.GetForm<customform&rt;("myform_id");
        }
    }
</customform></font></font>



Standards are great! Everybody should have one!

GeneralRe: How to only open one instance of a window form from parent form Pin
Pete O'Hanlon16-Nov-07 0:30
mvePete O'Hanlon16-Nov-07 0:30 
GeneralRe: How to only open one instance of a window form from parent form Pin
Pete O'Hanlon16-Nov-07 0:32
mvePete O'Hanlon16-Nov-07 0:32 
GeneralRe: How to only open one instance of a window form from parent form Pin
Deques16-Nov-07 0:09
Deques16-Nov-07 0:09 
GeneralRe: How to only open one instance of a window form from parent form Pin
Pete O'Hanlon16-Nov-07 0:29
mvePete O'Hanlon16-Nov-07 0:29 
GeneralRe: How to only open one instance of a window form from parent form Pin
Shpendh16-Nov-07 1:38
Shpendh16-Nov-07 1:38 
AnswerRe: How to only open one instance of a window form from parent form Pin
dan!sh 16-Nov-07 0:33
professional dan!sh 16-Nov-07 0:33 
Questionuninstalling application through code Pin
dan!sh 15-Nov-07 22:47
professional dan!sh 15-Nov-07 22:47 
AnswerRe: uninstalling application through code Pin
Pankaj - Joshi15-Nov-07 22:57
Pankaj - Joshi15-Nov-07 22:57 
GeneralRe: uninstalling application through code Pin
dan!sh 15-Nov-07 23:28
professional dan!sh 15-Nov-07 23:28 
GeneralRe: uninstalling application through code Pin
Pankaj - Joshi15-Nov-07 23:33
Pankaj - Joshi15-Nov-07 23:33 
QuestionC# call fortran dll Pin
wenshengluo15-Nov-07 22:33
wenshengluo15-Nov-07 22:33 
AnswerRe: C# call fortran dll Pin
Pete O'Hanlon15-Nov-07 22:41
mvePete O'Hanlon15-Nov-07 22:41 
AnswerRe: C# call fortran dll Pin
Vasudevan Deepak Kumar16-Nov-07 0:26
Vasudevan Deepak Kumar16-Nov-07 0:26 
AnswerRe: C# call fortran dll Pin
wenshengluo16-Nov-07 16:36
wenshengluo16-Nov-07 16:36 
QuestionHow to send Mass mails in short span of time. Pin
Satish - Developer15-Nov-07 21:57
Satish - Developer15-Nov-07 21:57 
AnswerRe: How to send Mass mails in short span of time. Pin
Corinna John16-Nov-07 1:04
Corinna John16-Nov-07 1:04 
QuestionPropertyGrid (Binding arraylist to PropertyGrid) Pin
CoSreejith15-Nov-07 21:01
CoSreejith15-Nov-07 21:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.