Click here to Skip to main content
15,898,897 members
Home / Discussions / C#
   

C#

 
GeneralRe: Packing and unpacking bits Pin
ScruffyDuck25-Nov-06 6:19
ScruffyDuck25-Nov-06 6:19 
QuestionHow to Add ToolStripButtons on a Child Form Dynamically... Pin
IamHuM24-Nov-06 21:21
IamHuM24-Nov-06 21:21 
QuestionUPDATING .MDB (please help me guyz!) Pin
Muammar©24-Nov-06 20:52
Muammar©24-Nov-06 20:52 
Questionconvert Java source codes to C# source codes? Pin
George_George24-Nov-06 20:26
George_George24-Nov-06 20:26 
AnswerRe: convert Java source codes to C# source codes? Pin
CWIZO25-Nov-06 4:06
CWIZO25-Nov-06 4:06 
GeneralRe: convert Java source codes to C# source codes? Pin
George_George25-Nov-06 21:28
George_George25-Nov-06 21:28 
QuestionCall one function from another Pin
Andrei Ungureanu24-Nov-06 13:15
Andrei Ungureanu24-Nov-06 13:15 
AnswerRe: Call one function from another Pin
Amar Chaudhary24-Nov-06 13:21
Amar Chaudhary24-Nov-06 13:21 
AnswerRe: Call one function from another Pin
Karthik Kalyanasundaram24-Nov-06 17:19
Karthik Kalyanasundaram24-Nov-06 17:19 
AnswerRe: Call one function from another Pin
Guffa24-Nov-06 23:19
Guffa24-Nov-06 23:19 
QuestionConnection String Pin
btota24-Nov-06 12:47
btota24-Nov-06 12:47 
AnswerRe: Connection String Pin
Andrei Ungureanu24-Nov-06 13:10
Andrei Ungureanu24-Nov-06 13:10 
AnswerRe: Connection String Pin
Dominic Pettifer24-Nov-06 13:47
Dominic Pettifer24-Nov-06 13:47 
QuestionHow to use multiple panels in a windows form Pin
Sonu.T24-Nov-06 12:38
Sonu.T24-Nov-06 12:38 
AnswerRe: How to use multiple panels in a windows form Pin
S. Senthil Kumar24-Nov-06 19:51
S. Senthil Kumar24-Nov-06 19:51 
GeneralRe: How to use multiple panels in a windows form Pin
Sonu.T25-Nov-06 21:12
Sonu.T25-Nov-06 21:12 
GeneralRe: How to use multiple panels in a windows form Pin
S. Senthil Kumar26-Nov-06 1:22
S. Senthil Kumar26-Nov-06 1:22 
Questionopen form at runtime Pin
lamtuanduc24-Nov-06 12:27
lamtuanduc24-Nov-06 12:27 
AnswerRe: open form at runtime Pin
Amar Chaudhary24-Nov-06 13:20
Amar Chaudhary24-Nov-06 13:20 
AnswerRe: open form at runtime Pin
S. Senthil Kumar24-Nov-06 20:31
S. Senthil Kumar24-Nov-06 20:31 
GeneralRe: open form at runtime Pin
lamtuanduc24-Nov-06 22:05
lamtuanduc24-Nov-06 22:05 
GeneralRe: open form at runtime Pin
S. Senthil Kumar25-Nov-06 1:42
S. Senthil Kumar25-Nov-06 1:42 
When handling the button click, do you already have instances of frmCus and frmSup? If you do, you can simply do
Form form = null;
if (txta.Text == "frmCus")
  form = frmCus;
else if (txta.Text = "frmSup")
  form = frmSup;

form.Show();


If not, you'd have to resort to using reflection to create instances of frmCus and frmSup, using Activator.CreateInstance.
Form form = null;
if (txta.Text == "frmCus" || txta.Text = "frmSup")
  form = (Form)Activator.CreateInstance(null, txta.Text);

form.Show();

This would create instances of frmCus and frmSup everytime you click the button, which may or may not be what you want. If you want to avoid creating instances everytime, you can have member variables in the class to refer to the instances created and then check for null before creating the instance.

Regards
Senthil [MVP - Visual C#]
_____________________________
My Blog | My Articles | My Flickr | WinMacro

QuestionRe: open form at runtime Pin
a-erfani2-Aug-12 22:49
a-erfani2-Aug-12 22:49 
Questionrandom number genration problem Pin
Amar Chaudhary24-Nov-06 12:21
Amar Chaudhary24-Nov-06 12:21 
AnswerRe: random number genration problem Pin
S. Senthil Kumar24-Nov-06 20:23
S. Senthil Kumar24-Nov-06 20:23 

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.