how to open a form within my project? i am using window.open but it ain't working. thanks
Printable View
how to open a form within my project? i am using window.open but it ain't working. thanks
have you tried window.show()? Where window is the name of the form?
- ØØ -
error says 'Project.Main doesn't contain a definition for open'
Do you have any forms open at all in this project? Or is this the first form that you will open when the app starts? If it is the first one, then try this:
Code:public static void Main()
{
Form form = new Form();
form.Text = "My Very Own Form";
Application.Run(form);
}
- ØØ -
yes i have, i am calling main on other form
Have you instansiated the other form? Made an object of it?
- ØØ -
the form is already exists i just added another form that calls it.
Now you totaly lost me. When you mean exists. Do you mean that you have made an object out of it? Do you care to post the code, so I maybe understand what you mean?
- ØØ -
aspx code
Code://Setup the button links
strScript = "JavaScript:return ViewBatch(" + intEmployeeID + ")";
this.btnView.Attributes.Add("ONCLICK",strScript);
html
Code:function ViewBatch(strEmployeeID)
{
intHeight = 600;
intWidth = 550;
intTop = (screen.height/2)-(intHeight/2);
intLeft = (screen.width/2)-(intWidth/2);
strFeatures = "resizable=no,scrollbars=no,status=yes,height=" + intHeight + ",width=" + intWidth + ",top=" + intTop + ",left=" + intLeft;
window.open("Main.aspx?EmployeeID=" + intEmployeeID ,"",strFeatures);
}
Ohhh..this is ASP? Why didn't you say so right away? I guess this Q belongs in the ASP section then.
- ØØ -
but i am using c#