Click here to Skip to main content
14,979,406 members
Home / Discussions / C#
   

C#

 
Answer[Message Deleted] Pin
Prajeesh27-Feb-09 0:29
MemberPrajeesh27-Feb-09 0:29 
Rantyou mean you with u Pin
Deresen27-Feb-09 0:51
MemberDeresen27-Feb-09 0:51 
GeneralRe: you mean you with u Pin
soulidentities27-Feb-09 3:06
Membersoulidentities27-Feb-09 3:06 
GeneralRe: you mean you with u Pin
Deresen27-Feb-09 3:15
MemberDeresen27-Feb-09 3:15 
GeneralRe: you mean you with u Pin
soulidentities27-Feb-09 3:28
Membersoulidentities27-Feb-09 3:28 
GeneralRe: you mean you with u Pin
Deresen27-Feb-09 3:52
MemberDeresen27-Feb-09 3:52 
GeneralRe: you mean you with u Pin
soulidentities27-Feb-09 3:58
Membersoulidentities27-Feb-09 3:58 
GeneralRe: you mean you with u [modified] Pin
Mirko198027-Feb-09 3:52
MemberMirko198027-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
Membersoulidentities27-Feb-09 3:59 
AnswerRe: How to pass button and form in a method ? Pin
Megidolaon27-Feb-09 1:06
MemberMegidolaon27-Feb-09 1:06 
Questiontracking the eye algorithm Pin
sanforjackass26-Feb-09 23:49
Membersanforjackass26-Feb-09 23:49 
AnswerRe: tracking the eye algorithm Pin
Calin Tatar27-Feb-09 0:03
MemberCalin Tatar27-Feb-09 0:03 
RantRe: tracking the eye algorithm Pin
sanforjackass27-Feb-09 0:14
Membersanforjackass27-Feb-09 0:14 
QuestionRe: tracking the eye algorithm Pin
sanforjackass27-Feb-09 0:26
Membersanforjackass27-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
Membersanforjackass27-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
Membersanforjackass27-Feb-09 1:22 
Questiondecrypt Pin
kanthgadu26-Feb-09 23:49
Memberkanthgadu26-Feb-09 23:49 
AnswerRe: decrypt Pin
Smithers-Jones27-Feb-09 0:05
MemberSmithers-Jones27-Feb-09 0:05 
GeneralRe: decrypt Pin
kanthgadu27-Feb-09 0:30
Memberkanthgadu27-Feb-09 0:30 
GeneralRe: decrypt Pin
EliottA27-Feb-09 3:16
MemberEliottA27-Feb-09 3:16 
AnswerRe: decrypt Pin
musefan27-Feb-09 0:15
Membermusefan27-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.