|
I do not know the exact solution:
But, see if this helps U.
Locate the line "Application.Run(new Form1());"
and enclose it within try catch.
try
{
Application.Run(new Form1());
}
catch(Exception exe)
{
}
Regards,
Arun Kumar.A
|
|
|
|
|
Gosh - it's pretty obvious what's going wrong.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
OK, I remember this. I told you days ago what to do.
You can't do this. Because, when you close this form, you cause the Form2 instance to also be closed/disposed. Instead, make form1 and form2 user controls, put them both on the one form, and switch between them.
Also, for goodness sakes, use real variable names and not TreeView1 and Form2.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
sorry i m not getting u
if u can please follow the following link
MBR IT-_NET 247 TreeView and ObjectDisposedException on microsoft_public_dotnet_framework_windowsforms.htm
its seems that it is giving me the exact solution of my problem .I did it also but ite not working. Can u guide after viewing this page that what to do.
Thanx alot for ur replies
|
|
|
|
|
That's not a link.
What the page you hoped to link to says does not matter. What you're doing is wrong. Create user controls, lay them out to be your two forms. Put them both on the one form, and then make only one of them visible at a time.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
EEmaan wrote: Form2 f=new Form2();
You are creating this object within the original form (where the TreeView1 is)... it is available only within the After_Select event. When you close a form, all objects that are part of that form are destroyed and references to those will no longer be valid.
Hope this helps.
|
|
|
|
|
Hi guys ,
I came across a piece of code similar to the below one.
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
ad test = new ad();
Ia id5 = test.testobj();
id5.display()
}
}
public interface Ia
{
void display();
}
public class b : Ia
{
public void display()
{
MessageBox.Show("do it man");
}
}
public class ad
{
public Ia testobj()
{
b gh = new b();
return gh;
}
}
My question is why should we typecast object gh to interface Ia in testobj() function as the interface object when we can directly use the object of class b to call display function.
Thans in advance,
sishya
-- modified at 5:54 Friday 27th April, 2007
|
|
|
|
|
Because the point of an interface is that lots of objects can impliment it, and, despite their differences, they can exist as an instance of that interface via the same collection, or variable.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
In this example, it is not necessary since the example doesn't do anything much. The reason to do so would be if other classes implemented the interface and you want to call display() for a collection of different classes using a common variable of type Ia.
GregD (My Blog on software development)
|
|
|
|
|
Hello I've got a problem.
In my office, the Port 1435 and 1433 under which my MSSQL Database runs is locked. But I have to use the db for the finish work of my apprentice. Is there something Like a Web based Sql Query Analyzer, where I can run SQL Code? With it I can generate my Stored Procedures and tables?
Best regards
succo
|
|
|
|
|
How does this relate to C# ?
You want to go to a website, which creates procs and tables on your local SQL Server, or which hosts one you can play with ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I search a Web Application, which i can use on my ASP.NET web space. (Something like that: http://www.codeproject.com/aspnet/WebSqlUtility.asp) The Application doesn't have to have an intelligent. I Program my Application on my local Computer and when I'm finish i will put it online. I will create script, which creates the SPs and Tables. The tool have only to exec the SQL-Code.
|
|
|
|
|
You didn't answer me - where would the database be, local to you, or local to the tool ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
sorry. local to the tool.
|
|
|
|
|
I found the "SQL Server Web Data Administrator" (http://www.microsoft.com/downloads/details.aspx?FamilyID=c039a798-c57a-419e-acbc-2a332cb7f959&displaylang=en). This is exactly, what I've searched for.
Thank you!
|
|
|
|
|
I dont see in the control that i can do it.
I need to create one sun in each node - can i use List View control ?
Thanks for any help.
|
|
|
|
|
Yes, you can put icons in the left of the list view control.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
What ? can you explain please ?
|
|
|
|
|
If you use a list view, you can associate an image list with it, and for each item, set an index into the image list for the image to show on the left corner.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks,
But i need also that each item will be check box - can i do it also ?
|
|
|
|
|
Gosh - talk about feature creep.
Yes, it can be done, but I'm not sure if it's built in, or if you need a custom control to do it. Search the code project articles, you should find something there.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Works for me. With a TreeView anyway, which is my weapon of choice, I prefer it over ListBox and CheckedListBox.
|
|
|
|
|
I have method to which object of Type ICollection is getting passed.
I want to create an object of List<> (Generic List) , with object of ICollection. Is that possible?
kumar
|
|
|
|
|
You can use the ICollection interface to iterate over the collection, and then put the items into a List, or whatever.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thanks, but i don't want to iterate, is that direct way, like while creating ArrayList object we can directly pass ICollection object to the constructor of ArrayList so that the contents of ICollection get copied to Arraylist object, is something like possible with generic List (List<>) object?
|
|
|
|