Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: Trouble with 'set' accessor Pin
mikeirwin2-Sep-03 9:21
mikeirwin2-Sep-03 9:21 
GeneralWriting and reading binary data Pin
padcom131-Sep-03 14:53
padcom131-Sep-03 14:53 
GeneralRe: Writing and reading binary data Pin
James T. Johnson1-Sep-03 16:57
James T. Johnson1-Sep-03 16:57 
GeneralRe: Writing and reading binary data Pin
James T. Johnson1-Sep-03 17:08
James T. Johnson1-Sep-03 17:08 
GeneralRe: Writing and reading binary data Pin
padcom132-Sep-03 5:01
padcom132-Sep-03 5:01 
GeneralRe: Writing and reading binary data Pin
Eric Gunnerson (msft)2-Sep-03 9:48
Eric Gunnerson (msft)2-Sep-03 9:48 
QuestionHow to call a form using reflection Pin
Ista1-Sep-03 14:20
Ista1-Sep-03 14:20 
AnswerRe: How to call a form using reflection Pin
James T. Johnson1-Sep-03 16:35
James T. Johnson1-Sep-03 16:35 
You can use the static method, Type.GetType, passing in the full class name of your form. Assuming that assembly has been loaded into the AppDomain a Type object for your form will be returned.

You can then use one of the Activator.CreateInstance overloads to create a new instance of the class represented by that Type object. Cast the returned object back to a Form and you can use it as normal.

public Form GetForm(string className)
{
  Form form = null;
  
  Type formType = Type.GetType(className);
  
  if( formType == null )
    return null;
  
  form = (Form) Activator.CreateInstance(formType);
 
  return form;
}
Its untested, but that should work for you.

James

At Jethro Tull's August 28, 2003 concert Ian Anderson mentioned that the group would be performing a medley of title tracks. The songs were "Songs from the Wood", "Too Old to Rock and Roll; Too Young to Die"; and from the Heavy Horses album, "Stairway to Heaven"
GeneralRe: How to call a form using reflection Pin
leppie1-Sep-03 18:50
leppie1-Sep-03 18:50 
GeneralRe: How to call a form using reflection Pin
James T. Johnson2-Sep-03 2:28
James T. Johnson2-Sep-03 2:28 
GeneralRe: How to call a form using reflection Pin
leppie2-Sep-03 7:08
leppie2-Sep-03 7:08 
QuestionIterate through class properties? Pin
vedbu1-Sep-03 13:33
vedbu1-Sep-03 13:33 
AnswerRe: Iterate through class properties? Pin
Ista1-Sep-03 14:14
Ista1-Sep-03 14:14 
AnswerRe: Iterate through class properties? Pin
Jim Stewart1-Sep-03 15:44
Jim Stewart1-Sep-03 15:44 
GeneralRe: Iterate through class properties? Pin
vedbu2-Sep-03 13:26
vedbu2-Sep-03 13:26 
QuestionAbout getting the decimal ASCII codes of the characters??? Pin
cemlouis1-Sep-03 12:13
cemlouis1-Sep-03 12:13 
AnswerRe: About getting the decimal ASCII codes of the characters??? Pin
leppie1-Sep-03 13:03
leppie1-Sep-03 13:03 
GeneralRe: About getting the decimal ASCII codes of the characters??? Pin
cemlouis2-Sep-03 6:10
cemlouis2-Sep-03 6:10 
QuestionHow to communicate a aspx page with a thread ( one thread per session )? Pin
zoltix1-Sep-03 11:48
zoltix1-Sep-03 11:48 
Questionhow to detect DbClick on a Row in DataGrid Pin
Anonymous1-Sep-03 8:27
Anonymous1-Sep-03 8:27 
AnswerRe: how to detect DbClick on a Row in DataGrid Pin
MeisterBiber1-Sep-03 9:19
MeisterBiber1-Sep-03 9:19 
GeneralValidate a form Pin
nico1931-Sep-03 6:10
nico1931-Sep-03 6:10 
QuestionHow fast is .NET? Pin
Cristoff1-Sep-03 5:46
Cristoff1-Sep-03 5:46 
Answerquestions Pin
Cristoff1-Sep-03 5:52
Cristoff1-Sep-03 5:52 
AnswerRe: How fast is .NET? Pin
Nish Nishant1-Sep-03 6:29
sitebuilderNish Nishant1-Sep-03 6:29 

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.