Click here to Skip to main content
15,888,199 members
Home / Discussions / C#
   

C#

 
Answer[Message Deleted] Pin
Prajeesh27-Feb-09 0:29
Prajeesh27-Feb-09 0:29 
Rantyou mean you with u Pin
Deresen27-Feb-09 0:51
Deresen27-Feb-09 0:51 
GeneralRe: you mean you with u Pin
soulidentities27-Feb-09 3:06
soulidentities27-Feb-09 3:06 
GeneralRe: you mean you with u Pin
Deresen27-Feb-09 3:15
Deresen27-Feb-09 3:15 
GeneralRe: you mean you with u Pin
soulidentities27-Feb-09 3:28
soulidentities27-Feb-09 3:28 
GeneralRe: you mean you with u Pin
Deresen27-Feb-09 3:52
Deresen27-Feb-09 3:52 
GeneralRe: you mean you with u Pin
soulidentities27-Feb-09 3:58
soulidentities27-Feb-09 3:58 
GeneralRe: you mean you with u [modified] Pin
Mirko198027-Feb-09 3:52
Mirko198027-Feb-09 3:52 
Let's see if I understood what you mean.
You want to pass to the showForm method the type of form to show and then show the kind of form desired.

If it's so, you can use reflection in the following way:

void ShowForm(Type formType)
{
    Form frm = Activator.CreateInstance(formType) as Form; // your type must be some kind of form
    if (frm != null)
    {
        frm.Show(); // showing the form
    }
    else
    {
        // formType is not a form, handle the error
    }
}


Is this what you wanted to do?

modified on Friday, February 27, 2009 11:14 AM

GeneralRe: you mean you with u Pin
soulidentities27-Feb-09 3:59
soulidentities27-Feb-09 3:59 
AnswerRe: How to pass button and form in a method ? Pin
Megidolaon27-Feb-09 1:06
Megidolaon27-Feb-09 1:06 
Questiontracking the eye algorithm Pin
sanforjackass26-Feb-09 23:49
sanforjackass26-Feb-09 23:49 
AnswerRe: tracking the eye algorithm Pin
Calin Tatar27-Feb-09 0:03
Calin Tatar27-Feb-09 0:03 
RantRe: tracking the eye algorithm Pin
sanforjackass27-Feb-09 0:14
sanforjackass27-Feb-09 0:14 
QuestionRe: tracking the eye algorithm Pin
sanforjackass27-Feb-09 0:26
sanforjackass27-Feb-09 0:26 
QuestionRe: tracking the eye algorithm Pin
Nagy Vilmos27-Feb-09 0:53
professionalNagy Vilmos27-Feb-09 0:53 
QuestionRe: tracking the eye algorithm Pin
sanforjackass27-Feb-09 0:57
sanforjackass27-Feb-09 0:57 
AnswerRe: tracking the eye algorithm Pin
Nagy Vilmos27-Feb-09 1:12
professionalNagy Vilmos27-Feb-09 1:12 
AnswerRe: tracking the eye algorithm Pin
sanforjackass27-Feb-09 1:22
sanforjackass27-Feb-09 1:22 
Questiondecrypt Pin
kanthgadu26-Feb-09 23:49
kanthgadu26-Feb-09 23:49 
AnswerRe: decrypt Pin
Smithers-Jones27-Feb-09 0:05
Smithers-Jones27-Feb-09 0:05 
GeneralRe: decrypt Pin
kanthgadu27-Feb-09 0:30
kanthgadu27-Feb-09 0:30 
GeneralRe: decrypt Pin
EliottA27-Feb-09 3:16
EliottA27-Feb-09 3:16 
AnswerRe: decrypt Pin
musefan27-Feb-09 0:15
musefan27-Feb-09 0:15 
AnswerRe: decrypt Pin
CPallini27-Feb-09 0:21
mveCPallini27-Feb-09 0:21 
GeneralRe: decrypt Pin
Nagy Vilmos27-Feb-09 0:54
professionalNagy Vilmos27-Feb-09 0:54 

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.