|
You need to setup keypreview for the form, and then listen to the KeyPress events. When the specified keys are pressed then call the necessary function. If I am correct some menu items can be automatically set for a key shortcut. So when the specified shortcut is pressed then the menu item click event is called automatically.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi, I'm a C# programmer, Can anyone tell me how can i take control to the system's hardwares ? and enable or disable them in Microsoft windows? by c# coding ?
---
thanks to U All ![Rose | [Rose]](https://www.codeproject.com/script/Forums/Images/rose.gif)
|
|
|
|
|
You could emulate everything by going through the Device Manager, but why would you want to do this? Shouldn't this be done by the end-user and not a computer program?
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi, im using a program called EES for calculating purpose. It supports using ones own compiled code, but requires specific header in the DLL file, and the file need to be renamed from .dll to .dlf.
When the program checkout the .dlf file, it will look for a function call, in delphi that would be:
function FuncName (var S:charstring; Mode:integer; Inputs:ParamRecPtr):double; export; stdCall;<br />
begin<br />
..<br />
In C++:
extern "C" {<br />
__declspec (dllexport) double SUM_C(char s[256], int mode, struct EesParamRec *input_rec)<br />
{<br />
...
In C# ???
Among many i tried:
public class Globals<br />
{ <br />
public static double SUM_C(char[] s, int mode, ref EesParamRec input_rec)<br />
{<br />
...<br />
(EESParamRec is a class that handles the EES call)
Full code and so on can be found here:
Page 218 and rest of chap 6(EES integration examples)[^]
Unfortunatly no mentioning of C#
Since EES is only used by engineers working with thermodynamics, the resources on the internet is close to non existing, i know this is a long shot, but please help if you can.
|
|
|
|
|
You'll have to get ahold of the manufacturer of EES and see what you have to do, or if it's even supported. From your decription, it would appear that whatever you use has to support writing a standard library .DLL. C++ and Delphi support this. C# and VB.NET do not.
|
|
|
|
|
Thanks for the answer, the manual also says that it must be dynamic link library, but i dident know that MS removed that from C# (new to coding), so currently im at a dead end. Im goana try to make a C++ wrapper for my C# code, and call it that way, ultimately im goana have to port the whole thing to C++ ... Anyways thanks again.
|
|
|
|
|
My final year project is Video Collection system using C# and in this project i want to store videos information and videos at remote server. i want to know how information is sent to server and how these data store in database at server. I have to submit my project on 10 April. Please help me.
Thanks 
|
|
|
|
|
abhishek29 wrote: I have to submit my project on 10 April
#sings#
I'm h-a-p-p-y! I'm h-a-p-p-y!
I know I am!
I'm sure I am!
I'm h-a-p-p-y!
Your going to FAIL! That is so sweet, I love it!
After a week of utter boolacks I get to read this and think 'fank thuck! One of these cupid stunts has feally rucked-up AND THEN COME TO TELL US!'
Gotta love it, I'll give you a five for pure entertainment, thank you!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Bad answer - 1.00/5 (1 vote) - I don't think so.
p.s. I'm still laughing
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
You have done no work on a final year project then come to us with four weeks left? That would barely give you debugging time.
Frankly if you take that attitude to your work then you deserve to fail. Working as an engineer requires commitment which you have not displayed.
|
|
|
|
|
On the positive side, at least he managed to choose a project
|
|
|
|
|
Computafreak wrote: On the positive side, at least he managed to choose a project
Indeed. When I started my final year at university I already knew what I wanted to do for my final year project. It was described as ambitious. But more impressive that the guy that just wanted to spend a year writing an essay on "Ubiquitous computing". The project I was doing was practical, it had outcomes, big ones, and was actually useful. In fact it was so useful we sold it! And 14 years later my code is still in use. (Now, that's a little scary)
|
|
|
|
|
1 month time given to me for coding. ok
what is the answer of my question.
|
|
|
|
|
|
abhishek29 wrote: Thanks
That's a pleasure. Don't mention it.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
No worries, I'll hire you just because you're one of the VERY few to at least choose a project (maybe you got someone here to "doubt" it for you, but hey).
Anyway, our Assistant Facility Manager quit today. I need someone to empty my trash every night, and I guess he didn't like getting his hands messy since I dump my coffee, leftover lunch and mouthwash (rense 3 times daily) into that bucket, which I call my "Junk Data Store"...
You'll have to take some tests first to make sure you're qualified though.
|
|
|
|
|
I was asked this question in an interview, and either I'm suffering from brain-lock or just plain dumb, but I didn't have an answer.
Anyone?
Marc
|
|
|
|
|
Hi Marc,
Have a read of this[^].
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
DaveyM69 wrote: Have a read of this[^].
Ah, that was an excellent writeup. Thanks so much!
Marc
|
|
|
|
|
Delegates can only have one subscriber, but events can have multiple subscribers.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Multicast delegates can have many - you can just declare your event as normal, but exclude the event word, and it will work as normal (until something blows up!)
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Read Davey's response above. Very, very useful information. It's sort of the "yeah, I knew that, but I never really thought about it" kind of thing. The perfect interview question!
Marc
|
|
|
|
|
I'm learning C# at the moment, as I build a new product. I'm in the process of defining the interfaces between parts of the application, and I didn't know you could include event s inside an interface declaration. Cool!
|
|
|
|
|
I'm not absolutely certain, but an event is a wrapper around a multicast delegate. It's made up of a pair of add/remove methods, and this prevents a method from calling
Button1.Click(this, null); or
Button1.Click = thisMethod; , thus overwriting all other methods hooked up to that event
|
|
|
|
|
That's like comparing the same species of grape from two different regions in France...
I think one difference is events can show up in Interfaces.
But, you can't Invoke an event from another class.
|
|
|
|