|
I don't think so. If there was infinite loop I would't be able to raise any events from menu items, I guess. Problem apears only when using standard window close methods (ALT-F4, or [x] button) and only after UserControl descendant remove.
Here's what i've found till now.
I've created new, very simple (empty) UserControl descendant. Added and removed programmaticaly from parent, and everything worked fine.
After that I've added new TextBox control to this new control, and...
problem returned.
I guess there's something with resources remove (maybe control disposing) but what? and how to manage with this? This is enigma to me
Regards
|
|
|
|
|
I get what you mean now, and it does not make sense why it should do this.
I have used user controls with code-behind adding user-controls dynamic removal just about any way you could think of. and have not seen this problem.
I am intrigued.
Do you have a code snippet to look at.
Steve
He who laughs last thinks slowest.
|
|
|
|
|
I'm not sure if this helps, but i had similar problem.
Try to remove focus from control before removing it..
When you remove control with focus application will not close correctly..
(It's bug in .Net)
i'm only pointer to myself
|
|
|
|
|
Thanks.
I've managed it couple hours ago, but my method is quite unspleasant IMHO.
I'm removing all child controls in this UserControl before removing it. It seems to be working since then.
Regards.
|
|
|
|
|
Does anyone know why all my event log entries include this statement?
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Better yet, does anyone know how to stop it?
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
It seems to be a standard insert from the .NET message file. It's a real pain, because it stops you from putting your own support link in the message.
If you want to get rid of it, you will need to write your own message file, and register the source the hard way. Have a look at http://www.codeproject.com/useritems/EvtVwr.asp[^] for more info.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hello all,
I use .NET deployment wizard to make an installer for my application. But during uninstall, the files which are created in the application folder, after installtion, are not removed. How can I make the uninstall remove the entire application directory?
BTW, can I set "Launch application" at the end of the installation process?
Thanks
Smitha
You are never given a wish without also being given the power to make it true. You may have to work for it, however.
-- Richard Bach
|
|
|
|
|
Does anyone know of a way to add a .NET control to an Access or VB6 form? I need to do this without editing the source code of the .NET control.
Any help would be greatly appreciated.
Thanks,
Steve
|
|
|
|
|
Okay. So maybe it is not so serious, but it appears to be a glaring mistake. This explains why group boxes, tab pages, check boxes, or any control cannot be made transparent by setting BackColor to Color.Transparent.
Get Anakrino[^] and take a look inside System.Windows.Forms.dll.
Navigate to System.Windows.Forms.Control::OnPaintBackground and see that it will call PaintBackground . Go to that method (still in Control class) and look at its code. Its code should start off with:
if (this.RenderTransparent)
this.PaintTransparentBackground(e, rectangle);
All the private property RenderTransparent does is check if the backcolor is Color.Transparent. Anyway, now we get to the core of the problem: PaintTransparentBackground . Here is its code:
internal void PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle)
{
Graphics local0;
Control local1;
POINT local2;
PaintEventArgs local3;
GraphicsState local4;
int local5;
local0 = e.Graphics;
local1 = this.ParentInternal;
if (local1 != null)
{
local2 = new POINT();
local2.y = (local5 = 0);
local2.x = local5;
UnsafeNativeMethods.MapWindowPoints(new HandleRef(this, this.Handle), new HandleRef(local1, local1.Handle), local2, 1);
rectangle.Offset(local2.x, local2.y);
local3 = new PaintEventArgs(local0, rectangle);
local4 = local0.Save();
try
{
local0.TranslateTransform((float) -local2.x, (float) -local2.y);
this.InvokePaintBackground(local1, local3);
local0.Restore(local4);
local4 = local0.Save();
local0.TranslateTransform((float) -local2.x, (float) -local2.y);
this.InvokePaint(local1, local3);
}
finally
{
local0.Restore(local4);
}
}
local0.FillRectangle(SystemBrushes.Control, rectangle);
}
Is this a true bug, or am I missing something?
Mike_V
Tech Support: "Do you have any windows open?"
Customer: "Are you crazy woman, it's twenty below outside..."
|
|
|
|
|
Thanks for pointing this out. It actually gives me another idea though. I wonder if this code for Transparency could be used to create a "Child" Form in an MDI App that would support a Transparency Level? To see what I am talking about, create a Form and set it's transparency to be 75% or so. Then watch your App run...looks nice don't it? Now, make that Form a child form and Blam! No more transparency.
Also, I have done some custom controls. In doing that you can set the Styles of the Control (i.e. Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)). I believe for the most part this usually works. I wonder if MS is checking for this flag and running the code differently depending on that?
|
|
|
|
|
I have created a .NET Windows Form control. This control is licensed, using the standard licenseing classes of .NET (License class, LicenseProvider class, etc).
This is working when the control is used in an application. However, it seems this does not work when the control is used in a wrapping control or a class library. Is this a known problem? Is there anything special to do?
|
|
|
|
|
i think the license info needs to be compiled into the execution app.
so if you include your control in another control , you will still need the license info in the host app...
//Roger
|
|
|
|
|
Unfortunately, this is not allways possible. Sometimes, you cannot change the the host app because you have not its source code. It is the case if you use the control under ASP.NET (aspnet_wp.exe). In such a case, it seems that the licensing provided by .NET is not working.
|
|
|
|
|
i actually think i read taht on gotdotnet , that control licensing doesnt work under asp.net .. but i could be way off here... but i think that was stated on some license page..
|
|
|
|
|
Does anyone know of a website or anything that could show me how to use/create windows metafiles? It would be great if there was a tutorial for VB.NET but if not VB 6 would suffice. Specfically, I'd like to create barcodes so any websites that could point me to a barcode format website would also be helpful. Thanks for any help in advance
|
|
|
|
|
I'm having a problem with the .NET installer. My program uses the MyODBC drivers for MySQL and I wish to install it when I install my program. I can create the screen that provides the check box "Install MySQL support" no problem. however when I got to the custom action property of the MyODBC driver, I can't seem to create the right expression that will evaluate to true or false. It's either always true, or always false. Any help will be gladly accepted.
|
|
|
|
|
I've found an infinate number of articles across the internet about how to impersonate a user. Fine. Dandy. What I need to know is how a Windows Service written in .NET can physically log the computer in, when NO user is logged in already, as if I'd hit Ctrl-Alt-Delete myself. I assume it has to do with the LogonUser API call, but it only returns a Token, and Impersonate user doesn't seem to do the trick (logically, or in practice). Any ideas?
Thanks in advance.
Kyosa Jamie Nordmeyer - Cho Dan
Portland, Oregon, USA
|
|
|
|
|
I don't know if it works, I never tried it, maybe a Create/OpenWindowStation call or a Create/OpenDesktop API could help.
The name of the desktop you probably are using right now is winsta0\default.
Maybe creating one could solve your problem, but I don't know if it is possible.
My latest article: GBVB - Converting VB.NET code to C#
|
|
|
|
|
Can anyone tell me how to create a completely hidden windows form. I'm using it just for its message pump. I best I can do at the moment is hide from view, taskbar but no the Alt-Tab menu. And the user can still close it when it has focus and using Alt-F4.
I'm using a hidden form as I want to pass data using BeginInvoke between threads.
|
|
|
|
|
Hi all. I'm writing a service that launches a house-built app, but I need it to log the computer in first. We have the, um, fortune of running both Windows and Novell networks, and the files that the spawned app need are on the Novell network. So my launcher service needs to log the machine in, or my spawned app won't be able to run. Any ideas on how to log a computer in from a service? I know it can be done, because I've seen other apps do it. Just don't know how.
Thanks in advance.
Kyosa Jamie Nordmeyer - Cho Dan
Portland, Oregon, USA
|
|
|
|
|
I dont think you can logon, why not give Novell rights to the service then?
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hi,
I should develop a new interface (Gui) for an old calculation program. All the routines are written in C++ Code. Can I develop the gui with c# in .not and use the c++ for the calculation? Can I just copy the old code and recompile it to get managed code which I can use in the C# Program!??
Hope yxou can help me how I can use the old code for my new project!
Thnx Ingo
|
|
|
|
|
Its just a matter makking a few .NET wrapper methods in MC++, and then just call them from your C# code.
Example:
I compile the dot.exe from GraphViz in normal C/C++. To make it a .NET dll all I did was to wrap the main function in a static method in a managed class and compile to dll. The only CLR options you need to set is on the wrapper file.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Thnx for your answer, but I'm still a bit confused...
Do you have a more detailed example or some links were wrapping is explained. My problem is, that I am not really familiar with c++, but I have to add some c++ functions...
Example:
I only define a class in c++ and compile it to a dll under VC 6.0.
Class xyz
{
xyz()
{printf("Hallo");}
int add(int a, int b)
{
return a+b;
}
}
How can I call this class out of c#? How can I create an instance of xyz or call the add function?!
Please, I really need some help!
|
|
|
|
|
Hey all. I've written a Windows Service using Visual Studio 2003, added an Installer to it using the 'Add Installer' verb, and verified that the 'RunInstaller' attribute was present, and set to True. Check, check, and check. Yet, when I try to install the stupid thing using InstallUtil.exe, I get the following error:
No public installers with the RunInstallerAttribute.Yes attribute could be found in...
Excuse me? Yes there are! Anyway, from searching Google, it almost looks like this might be a bug in VS 2003. Any ideas? If nothing else, does anybody know what keys I need to manually create in the registry to make it work?
Thanks in advance.
Kyosa Jamie Nordmeyer - Cho Dan
Portland, Oregon, USA
|
|
|
|