|
You need to keep the forms object somewhere, and check it's IsDisposed property before creating new Form instance. If it is not Disposed, use BringToFront() to give focus to that form. If it is disposed, create new instance and store it.
|
|
|
|
|
N a v a n e e t h wrote: check it's IsDisposed property
I think(not sure) dispose method handle this part, or when we closes the form it get called?
a) Now how can i ues this property?
Do i have to use the click event of menuItem.
N a v a n e e t h wrote: You need to keep the forms object somewhere
b) Not clear?. what do u mean by this, as i am creating object of form, on the context menu form. How i keep the form object somwhere?
c) What about the checked property?
|
|
|
|
|
humdumof wrote: or when we closes the form it get called?
When the form is closed, Disposed property will be set to true. If form is active, it will be false.
humdumof wrote: Not clear?. what do u mean by this, as i am creating object of form, on the context menu form. How i keep the form object somwhere?
Declare an ArrayList instance as public in the class. In the context menu click, check ArrayList has any form instances. If yes check it's IsDisposed property. If it's disposed, created new instance and add that to array list. If not disposed, cast it to form and call BringToFront() method.
Hope it helps.
|
|
|
|
|
You could try using mutex to check if an instance of the program is already open or not..
Sorry i cant help you too much with mutex, however google and msdn have a lot of articles about it.
|
|
|
|
|
Use ShowDialog() instead of Show()
Becoming Programmer...
|
|
|
|
|
hi
My aim is to delete a paricular array element and sort it
example
int[] array1 = new int[5];
array1[0] = 1;
array1[1] = 2;
array1[2] = 3;
array1[3] = 4;
array1[4] = 5;
now i want to delete the array[2] element and bring the array it the order
1245
plz tell me how to do this
regards
sindhu tiwari
Always Innovative
|
|
|
|
|
Why don't you use an ArrayList ?
|
|
|
|
|
sir if u dont mind plz tell me in brief...
sindhu tiwari
its me sid
|
|
|
|
|
ArrayList is a collection class which can hold object types. You can use that . It provides built-in support for removing and sorting.
|
|
|
|
|
ArrayList array1 = new ArrayList();
array1.Add(1);
array1.Add(2);
array1.Add(3);
array1.Add(4);
array1.Add(5);
now if you delete any element then just call array1.Sort()
Becoming Programmer...
|
|
|
|
|
You can't delete items from an array. The size of an array can't be changed.
Use a list instead:
List<int> list1 = new List<int>();
list1.Add(1);
list1.Add(2);
list1.Add(3);
list1.Add(4);
list1.Add(5);
list1.RemoveAt(2);
The list now contains 1, 2, 4, 5.
There is also a Sort method, if you for example want to add an item and sort:
list1.Add(2);
list1.Sort();
The list now contains 1, 2, 2, 4, 5.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi
Sorry to paste vb code instead of c# code.
Please help me. How to add rows dyanamically in c#, when i am clicking addbtn it shows only one row. How can add more than 2 rows. Plz help me.
laxmi
|
|
|
|
|
What are you adding rows to? If you want to add more then one row then handle the button click event and add as many rows as you wish
|
|
|
|
|
Thank u for your suggestion. But when i am adding rows to table dynamically, it refresh the page and previous data gone. how can add more rows to a table without refreshing page.
Please Help me.
laxmi
|
|
|
|
|
Laxmi R wrote: But when i am adding rows to table dynamically, it refresh the page and previous data gone.
ASP.NET ? This is C# forum.
Laxmi R wrote: how can add more rows to a table without refreshing page.
You could use AJAX for this.
|
|
|
|
|
Thank You for your reply. Please give me example code. Plz help me.
Thanks in advance.
laxmi
|
|
|
|
|
Laxmi R wrote: Please give me example code. Plz help me.
If you are using ASP.NET 2.0, try AJAX toolkit. It's good one and easy way to implement AJAX. Put your table and button inside updatepanel control.
|
|
|
|
|
hi all
can anyone have this dll file CrystalDecisions.ReportAppServer.ClientDoc.dll ,please do share it with me or provide me the link where i can get this dll.
pintoo
|
|
|
|
|
Nope. Move along now.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
C:\Program Files\Common Files\Business Objects\2.7\Bin
This is the path u get this dll
|
|
|
|
|
Hello!
I have user control application, using Activex(written in c++) and I 'm getting following error:
ActiveX control XXXXXX cannot be instantiated because the current thread is not a single-threaded apartment.
I'm now developing on .net2005. I had the same application on .Net 2003, but it worked there without any problems.
I'm stucked and will appreciate any help
Thanks
|
|
|
|
|
wrote: ActiveX control XXXXXX cannot be instantiated because the current thread is not a single-threaded apartment.
Kind of tells you all.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
can any one tell me how to check whether an email id entered by a user is a valid one or not. I think it should be done using socket programming. I don't have any idea in socket programming.
Kindly help me in solving this problem.
|
|
|
|
|
Please use regular Expression.
Continue...
|
|
|
|
|
Hi,
Email validation means not using Validation Controls in ASP.NET.
I want to check whether the domain and that emailid exist or not.
Suppose a user has entered an email like asd@yahoo.com
In that I want to check whether that domain exist or not. Afterwards
I want to check whether that email exist or not.
|
|
|
|