I am having a problem with passing a button and form to a method.
Let me explain detail.when i click a button it will send some this button and a form to a method. The method then do some job. like
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 formif (frm != null)
frm.Show(); // showing the form
// formType is not a form, handle the error
I can't realy understand your examples (your naming is srtoa off), but if you just try to pass a button and a form to a method, they are objects like everything else.
void PassButton(Button myButton)
//Do stuff with myButton
void PassForm(Form myForm)
//Do stuff with myForm//Form is the class from which your own for is derived, you can cast it to//any form you want or use your selfmade Form (like F_Main)
1) Republic of Ireland algorithm? Never heard of it.
2) This does sound suspiciously like a google question and google will serve you a delicious feast of answers if you try.
3) Find out what you want to do and come back with any problems you have doing it.
That's all. Any more of these half brained antics and I'll start getting grumpy.
i'm using first time code project i don't know how to ask a qestion properly.actually the problem is my project is in vb6.0 now we r changing to c#.net .in vb project backend is ms-access in that text is encrypted.that text will be appear oriya in c#.net.that's y i'm trying to converting .i take one windows application one textbox n button in the textbox i write english word wen i clicked on the button that word will be changed to oriya language.i searched in google but the xamples r coming but those r webapplications.
Last Visit: 31-Dec-99 19:00 Last Update: 11-Dec-23 6:10