|
Let me clarify this. I'm not restoring anything...
The situation is that FormA is maximized on on monitor. Then FormB is created and maximized on the other monitor (by the user). If the user clicks on the minimize button of FormA than both forms are minimized. So far so good. If the user reactivates FormA then FormA gets restored to full size but not FormB.
|
|
|
|
|
Surely you can't reference yourself in f.Owner. Form.Owner sets a reference to another Form which owns it. Top-level forms can't have an owner, which is what I'm assume you are doing by referencing yourself.
I'm could be wrong though!
Graham.
-- modified at 19:31 Tuesday 25th April, 2006
On further research, when a parent form is minimized or maximized is also minimizes or maximizes it's owned forms. This would account for your code hanging as it's getting into an infinite loop due to f.Owner.
|
|
|
|
|
Have a closer look at my code. It resides in FormA (which is this ) and sets itself to a brand new instance of FormB. So no self referencing and also no hanging or infinite loop.
|
|
|
|
|
Opps...
Misread your code!
|
|
|
|
|
|
Are you asking how do you connection to an SQL Server without using that control?
string myConnectionString = "Initial Catalog=databaseName;Data Source=sqlServerName or localhost;";
SqlConnection myConnection = new SqlConnection(myConnectionString);
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 12:34 Wednesday 26th April, 2006
|
|
|
|
|
I'm trying to find a way of getting a list of files which are locked by other processes. I'm sure this can be done in .net without resorting to win32 api calls, but without spending days drilling into MSDN I'm hoping that someone already has an answer for vb.net 2.0 if poss.
http://www.ViSYNERGY.com
End of Line.
|
|
|
|
|
Arkett wrote: I'm sure this can be done in .net without resorting to win32 api calls
No, it can't. There is no support built into the .NET BCL to do anything close to this. You MUST start calling into Win32. I take it you've already found an example and didn't like what you saw?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Please don't reply to this thread telling me what I can't do if you're not going to follow it up by telling me what I can do. It's just a waste of your time and mine.
http://www.ViSYNERGY.com
End of Line.
|
|
|
|
|
Arkett wrote: Please don't reply to this thread telling me what I can't do if you're not going to follow it up by telling me what I can do.
First, you haven't answered my question in my original reply.
Second, I did at least partially answer your question. There is absolutely no support in the .NET Framework for what you want to do.
Now, having said that, it narrows down your search parameters. Lastly, sorry, but I must have left out the part about "Now you can Google for it yourself using the narrowed down parameters of "process open files"!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
This has been something of an object lesson in futility. At the beginging of this exploration I had entertained hopes for the system.diagnostics.process class, but I now know that although I can get a good deal of information about running processes, including a handles count, a list of open file handles is not available. More research has concluded that the functionality I'm trying to expose in my programme is only available via the NT Native API, which is way beyond the scope of anything I can hope to achieve at the moment. I have spent two days googling till I'm blue in the mouth and trawling up and down inside MSDN and got nowhere. I did however get a few insights into some interesting things which may well be useful in the future, so it hasn't been a complete waste of time.
Thanks to Dave Kreskowiak for - well nothing very much.
TTFN
http://www.ViSYNERGY.com
End of Line.
|
|
|
|
|
Is there and way of releasing XML data from a Pocket PC's Memory other than rebooting it. I have experienced problems in that it constantly remembers prevoius data in XML document. I have read recently where in VB2005 you can release a database from memory. Any advise would be appreciated.
HollyMax
|
|
|
|
|
how to use nmake on Command Prompt?
|
|
|
|
|
Thanks For everyone who did not try to help, i did it
|
|
|
|
|
What? You really wanted us to tell you to type "NMAKE /?" at a command prompt?
Are your fingers so broken that you couldn't type www.Google.com and look up your VERY generic question yourself?
Let me give you another version of your question and let you in on why you didn't get an answer... "How do I use a car?" Does any explanation less than 10 paragraphs come to mind?
BTW, Congratulations on figuring it out yourself! Around here, we try to get people to learn how to do their own research instead of having us spoon feed it to them. It's the SINGLE most important skill you can have writing code for a living...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you my brother , it is really best advice comes to me
|
|
|
|
|
I'm getting very often but not always some kind of error dialog when I quit my app in C# that uses some COM objects. Unfortunately I can't tell what it is because when it pops up the application closes in like 10th of a seccond and I can't see what's the dialog about. This is release build. Debug doesn't report anything in debugger on exit ever. I understand it's very vague but I still need help and hope someone here can help me. How to catch the error?
Thanks a lot for help in advance!
|
|
|
|
|
Does the error dialog look like a one from the framework, the COM objects or a custom one or none at all?
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
It looks like a runtime error dialog.
|
|
|
|
|
Can you provide a bit more background as to what the application does, e.g. what are the COM objects but more importantly what is being done when your application shuts down.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
I think I free all(!) the COM object using Marshal.ReleaseComObject. COM object do different things - one goes across winsock to a server the other loads msscript ctrl to execute some vbscripts.
What's strange is that I have try-catch-finally in my main function of program around all those three lines including application.run, bug now debugger (debugging release) reports an thet there's an exception InvalidComObjectException beeing raised after! that try-catch-ficnally block - so after everything is run.
|
|
|
|
|
So you've basically got:
static void Main(string[] args)
{
try
{
Application.Run(new MainForm());
Marshal.ReleaseComObject(msscript);
Marshal.ReleaseComObject(winsock);
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
}
Am I right?
(One thing I just thought of, do you dispose the msscript or winsock first because if the msscript control is disposed of second then it might be trying to access the winsock control (if you allow this interaction)).
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi,
I have such a problem: trying to animate gif with ImageAnimator, and it's displaying it much faster than gif is displayed in all other programs like browsers and ACDSee. Does anyone know why is it so and what can I do with all this?
Thanks,
Alex
|
|
|
|
|
Please list .NET Framework 1.1 and 2.0
|
|
|
|
|
google search results.
Please google first next time!
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|