|
I'm creating and opening new forms from a main form, set its name randomly and call Form.Show() method to show it. Now the problem is how can i detect if user has closed that form or it's still opened? or its closed and disposed.
Thanks in advance!!!
Best Regards,
Rizwan
|
|
|
|
|
How about keeping a reference and checking IsDisposed and Visible property.?.
www.troschuetz.de
|
|
|
|
|
Thanks for your interest in helping me. But I think it's not effecient way that I maintain my own global list to count the opened forms. I hope that C# will be having some built in solution for that.
Best Regards,
Rizwan Ahmed
|
|
|
|
|
In my opinion keeping a list of references wouldn't be that inefficient.
Anyway, as far as I know there is no .NET way to interact with a form you have no refernce for. Maybe there is one since 2.0 but i haven't used it until now. If not, keep a look at the findwindow function which you can pinvoke.
www.troschuetz.de
|
|
|
|
|
Thanks, I'm using 2.0 and also know about findwindow and used it in the same application but some other purpose. Lets see if i can get some better solution otherwise i know different ways to do it. Thanks alot!!!
Best Regards,
Rizwan
|
|
|
|
|
Why should C# care how many forms you create and what you do with them?
Each Form is an instance of a class like thousands of other instances.
You want your forms to do something meaningful so you'll have to see to it yourself.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi,
I'm trying to build a kind of a plugin-factory and I'd like to load these 'plug-ins' at run-time all using the same interface ect..
What I'm missing is a way to load the Class from a dll file into my program at run-time.
Using .NET 2.0 would be preffered but I'm kinda easy as long as I get a viable solution
thanks,
HHG
|
|
|
|
|
Looking for something like this:
string[] filePaths = Directory.GetFiles(FormMain.PluginsDirectoryPath, "*.dll");
for (int i = 0; i < filePaths.Length; i++)
{
try
{
Assembly assembly = Assembly.LoadFrom(filePaths[i]);
Type[] types = assembly.GetTypes();
IPlugin plugin;
for (int j = 0; j < types.Length; j++)
{
if (types[j].GetInterface(typeof(IPlugin).FullName) != null)
{
plugin = (IPlugin) Activator.CreateInstance(types[j]);
this.plugins.Add(plugin);
}
}
}
}
www.troschuetz.de
|
|
|
|
|
Thanks alot, this seems promising
|
|
|
|
|
Hello!
I'm documenting my C# project using XML comments (and building a CHM later using NDoc). Now I got a problem: I have an enum that contains many values and these values do not need to be documented, they are self-explanatory.
public enum Icons
{
None = 0,
Directory,
Apple,
Banana,
Computer,
...
}
Hundreds of icons. Now I want to document the enum itself, but not any of the possible values. Unfortunately, when compiling with level 4 compiler warnings, each value gives me a warning about a missing XML comment.
Is there any way to suppress such XML comment warnings?
Thanks in advance and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
You can just disable the specific warnings in the compiler options.
|
|
|
|
|
But I don't want to disable all enum XML comment warnings... I only want to suppress the warnings for this specific enumeration.
Thanks for your reply and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hi
There's no way to do what you want in .Net 1.1.
In .Net 2.0 you can use #pragma warning .
----------------------------
Be excellent to each other
EasiReports[^] My free reporting component for WinForms.
|
|
|
|
|
I'm using .NET 2.0.
Thanks for the tip! Works perfectly
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
hello all and thank you for your efforts
i am having a problem with declaring and using delegates. and what is the relation bet delegates and events in general.
what is a delegate?
what is an event in relation to delegates?
thank you very much
abdelhameed81@yahoo.com
abdelhameed81
|
|
|
|
|
|
hi
how to create and extract ISO file using c# technology
thanks
Raj
Project Leader
india
small
|
|
|
|
|
hi guys
if any one knows how to create virtual dirve using c# e.g. mount and unmount etc..
Rah
Project Leader
India
small
|
|
|
|
|
I'm testing this code and all I get is a freaking unhandled FormatException, I don't know why but it tries to parse an int from the string I send as parameter. Why is this happening?
<br />
PerformanceCounter pc = new PerformanceCounter( "Memory", "Available MBytes" );<br />
try<br />
{<br />
Console.WriteLine( "Available RAM: " + pc.NextValue().ToString() + "MB" );<br />
}<br />
catch (Exception e)<br />
{<br />
Console.WriteLine(e.ToString());<br />
finally<br />
{<br />
pc.Close();<br />
}<br />
The exception: System.FormatException was unhandled.
Message="Input string was not in a correct format."
at System.Int32.Parse(String s, IFormatProvider provider)
at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
at System.Diagnostics.PerformanceCounterLib.get_NameTable()
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CounterExists(String category, String counter, Boolean& categoryExists)
Thankful for any help. Is this class supposed to be used in another fashion since 2.0?
|
|
|
|
|
hi
i tried to insert to listview for each row a new image when i try to do it i see always the same image
what do i need to do?
thanks
have a nice day
|
|
|
|
|
How do I do voice chat.
How to convert voice into bytes.
Any Idea abt this .Please send me.
|
|
|
|
|
If you have got some solution for Voice Chat. Please also let me know how to do that. How are you capturing sound from Mic? if you are ready to convert it to byts? Please also help me if you get some clue. Thanks in advance.
Best Regards,
Rizwan Ahmed
|
|
|
|
|
Do one thing. Download VaxVoIP SDK from net. I think google search will help you to do that. VoIP is the better way of communication through Voic and text
.
Cheers
|
|
|
|
|
I have to view all drives,directories,files of a remote machine in to my
local machine.How can I do that in use of Tcp socket.
Deepthi
|
|
|
|
|
In my point of view, Remoting will be the simplest way to do that.
You can find a lot of articles on coderproject on remoting.
The idea is:
1) you'll write a remotable object (dll) with some function who gets this information from the local computer and returns this information to its caller. This information must be in serailizable form. you can use XML or even a string as a return type. All you need is to re calculalte you information from that returned value back.
2) A Server will expose this object to be called by the clients on a specific URI.
3) Client will use a proxy of that remotable object and connect to the server by registering a channel and Call that method remotely just like its a local function of it, get the required information.
I have tried to give you some idea. Please read some article about remoting. You'll achieve your goal within 30 minutes for sure after understanding remoting.
Best Regards,
Rizwan
|
|
|
|