how to invoke new window in windows applcation

Posted by Amritha444 under C# on 3/7/2012 | Points: 10 | Views : 1251 | Status : [Member] | Replies : 7
Hi all

Normally i invoke new window like this

frmmaster obj=new frmmaster();
obj.show();

but now iam fetching this form name from database which i stored in a string let it be ls_formname .
how to invoke that form from this ls_formname .

Thanks in Advance




Responses

Posted by: Gow.Net on: 3/7/2012 [Member] Starter | Points: 25

Up
0
Down
it possible send you coding

gowthaman8870226416

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amritha444 on: 3/7/2012 [Member] Starter | Points: 25

Up
0
Down
hi vimal

If you know how to call form by using its string name.Plz tell me how to code for the same

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gow.Net on: 3/7/2012 [Member] Starter | Points: 25

Up
0
Down

hi Amritha444

please ask your doubt in clearly else u attach your coding


gowthaman8870226416

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 3/7/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi Ameetha,
Develope a method that return Form object from FormName
and rest Code is Same

Form obj = MyMethodReturnsFormFromName("<your-form-name>");
obj.Show();


Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amritha444 on: 3/7/2012 [Member] Starter | Points: 25

Up
0
Down
hi vimal and Hmanjarawala

Thanks for the response
i will explain my need

usually i call windows form by creating object.
If i want a screen named frmcompany . i write code as
frmcompany obj=new frmcompany ();
obj.show();

But in my current case this formname will be in one string variable .let it be ls_com_name
ls_com_name="frmcompany ";//this value getting from database not constant
how to call frmcomapny from string ls_com_name.
there isnt method like ls_com_name.show();
what to use instead..




Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 3/7/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi amritha....
i already understood what you want to convey....
now there is no direct way to invoke form...
that's why i told you to create method which return Form type object from name....

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 3/7/2012 [Member] Starter | Points: 25

Up
0
Down
Refer this

http://www.techotopia.com/index.php/Hiding_and_Showing_Forms_in_C_Sharp

Thanks&Regards
LakshmiNarayana Nalluri.

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response