Couple of things:
1) KeyUp is probably not a good place to disable keys, as KeyPress happens repeatedly before KeyUp occurs. Try handling KeyDown, KeyPress and KeyUp with Console.WriteLine in each to show the flow of events.
2) If you are going to use magic numbers then comment the damn things so the next poor sod stands a chance of understanding what you are doing:
// Disable '%' keycase52:
is a lot more useful than
By preference, use '%' instead of magic numbers, or constants with sensible names, or even "Keys."
3) Use KeyPress to disable your code:
I'm having an error in my application that is confusing me.
The error is this one:
Could not find a part of the path "C:\CrkBusinessplatform\Aplicacao\Publico\sistemas\ccs\CRK.Monitores\sistemas\ccs\CRK.Monitores\monitor_arquivos\xslt\ACCS001.xslt"
Here are the facts: The correct path would be C:\CrkBusinessplatform\Aplicacao\Publico\sistemas\ccs\CRK.Monitores\xslt\ACCS001.xslt -> A part of the path is coming twice.
The archive ACCS001 is in this correct path.
The code line of the error is like this:
I'm using .NET 1.1 on IIS 6.
The folder CRK.Monitores is a virtual directory in IIS. So the code should return the right path, right?
Oh, one more thing. The DLL of this page is the same here and there(I have checked it). And the error does not occur here.
Have you tried echoing Page.Request.PhysicalApplicationPath to confirm that what you think it outputs is what it actually outputs? To me, this looks like you're making a false assumption about the returned value.
want a Auto hide control component. The control like Visual studio 2008 IDE Solution Explore or Tool view.. If mouse over or click Tool view , tool view item are expanded... i want like control... how can create this control or if its in build control , name of that control and how use that control
I have created a custom video player in C#. This player has two forms.
1. The Video Player window ( running in primary (UI) thread )
2. The content playing window (running in a secondary thread)
Everything goes fine for nearly 5-6 hours, then the main video player window freeze.So i cannot access any of the buttons (stop, pause ,exit) in the player.
But the secondary thread keeps playing the files for even two days continuously ( which is the max i tested).
Things i have checked :
1. There is no memory issue, since i dispose the objects i create after playing each file ( few min videos) . I have checked the process in task manager, where status is running and memory usage as same as it is started.
2.I have used BeginInvoke from secondary thread to update the current playing file in the list box on the main video player window ( once the main window freeze, the update is not visible)
3. I have used a timer in the main video player window and tried refreshing form , calling Application
.DoEvent() for every few minutes , still it gets freeze up after 5-6 hours.
Why the UI window freeze up?
Is my architecture for the player is wrong?
(I need to do lots of processing in secondary thread for the images and videos to be played, but it is working fine)
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison. Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.