Click here to Skip to main content
12,512,515 members (31,600 online)
   

C#

 
GeneralRe: C# Performance Issue Pin
SledgeHammer0118-Aug-14 4:52
memberSledgeHammer0118-Aug-14 4:52 
GeneralRe: C# Performance Issue Pin
Pete O'Hanlon18-Aug-14 4:56
protectorPete O'Hanlon18-Aug-14 4:56 
AnswerRe: C# Performance Issue Pin
jschell18-Aug-14 11:51
memberjschell18-Aug-14 11:51 
QuestionC#/JS problematic iteration with table... Pin
OmegaExtern16-Aug-14 17:23
memberOmegaExtern16-Aug-14 17:23 
AnswerRe: C#/JS problematic iteration with table... Pin
Richard MacCutchan16-Aug-14 21:11
protectorRichard MacCutchan16-Aug-14 21:11 
QuestionC# Keybind for Autoclicker Pin
Member 1101699616-Aug-14 16:39
memberMember 1101699616-Aug-14 16:39 
AnswerRe: C# Keybind for Autoclicker Pin
Zain Ul Abidin16-Aug-14 19:49
memberZain Ul Abidin16-Aug-14 19:49 
AnswerRe: C# Keybind for Autoclicker Pin
OmegaExtern16-Aug-14 20:44
memberOmegaExtern16-Aug-14 20:44 
First off all, you are dealing with deprecated method (mouse_event).
Second, I think you will need KeyPreview enabled/set to true for your form (look on Form1 properties).
Third, "if (e.KeyCode.ToString() == "F") ;" wtf?
That "if" branch statement does nothing, why? You assigned it to empty (;) and by not using "{" and "}" it basically mean "if" is limited to single line.. code style..
Fourth, your if statement comparison should be made from "e.KeyCode.ToString() == "F" to "e.KeyCode == Keys.F".
Fifth, are you sure your events (timer1_Tick/Form1_KeyDown) are assigned, that could be a main cause, "this code does nothing", as I don't see anything in your constructor, "InitializeComponent();", and you didn't posted code of your (*.Designer.cs) Form1.Designer.cs file in this case.
Sixth, it is a lot of bad practice in here so I will jump to seventh.
Seventh, you can't just copy/paste into C# always double-check everything such as Win32 native API you deal with, it maybe have wrong signature from my experience there are a lot of examples also 90% of all Windows native APIs from pinvoke.net are NOT correctly defined, so sad...
I have fixed your code, and it works fine for me, all you need to do is keep up with my friendly warnings.
If you are not that smart, well, here is my smart suggestion for you, why not do:
"timer1.Enabled = Keys.F;" in Form1_KeyDown event (Keys.F will be 1/true when hold down; otherwise 0/false).
And yeah, do not forget mouse_event() is deprecated method and is no longer officially supported (so I should not be even giving you away these nice warnings).
Switch to SendInput function with structures, it is not that hard.

Best regards, OmegaExtern.

modified 17-Aug-14 2:55am.

GeneralRe: C# Keybind for Autoclicker Pin
Member 1101699616-Aug-14 20:47
memberMember 1101699616-Aug-14 20:47 
GeneralRe: C# Keybind for Autoclicker Pin
OmegaExtern16-Aug-14 20:50
memberOmegaExtern16-Aug-14 20:50 
Questioncheck array value exists Pin
scottichrosaviakosmos16-Aug-14 3:11
memberscottichrosaviakosmos16-Aug-14 3:11 
AnswerRe: check array value exists Pin
jlopez78816-Aug-14 3:34
memberjlopez78816-Aug-14 3:34 
GeneralRe: check array value exists Pin
scottichrosaviakosmos16-Aug-14 4:03
memberscottichrosaviakosmos16-Aug-14 4:03 
AnswerRe: check array value exists Pin
OriginalGriff16-Aug-14 3:39
protectorOriginalGriff16-Aug-14 3:39 
QuestionCatching exceptions on backgroundworker Pin
pjank4215-Aug-14 19:44
memberpjank4215-Aug-14 19:44 
QuestionRe: Catching exceptions on backgroundworker Pin
Richard MacCutchan15-Aug-14 21:25
protectorRichard MacCutchan15-Aug-14 21:25 
AnswerRe: Catching exceptions on backgroundworker Pin
pjank4216-Aug-14 1:50
memberpjank4216-Aug-14 1:50 
GeneralRe: Catching exceptions on backgroundworker Pin
Richard MacCutchan16-Aug-14 5:10
protectorRichard MacCutchan16-Aug-14 5:10 
AnswerRe: Catching exceptions on backgroundworker Pin
Eddy Vluggen16-Aug-14 2:10
professionalEddy Vluggen16-Aug-14 2:10 
AnswerRe: Catching exceptions on backgroundworker Pin
jschell17-Aug-14 9:56
memberjschell17-Aug-14 9:56 
GeneralRe: Catching exceptions on backgroundworker Pin
pjank4218-Aug-14 8:40
memberpjank4218-Aug-14 8:40 
QuestionMissing TCP Packets Pin
M Riaz Bashir15-Aug-14 19:24
memberM Riaz Bashir15-Aug-14 19:24 
AnswerRe: Missing TCP Packets Pin
Dave Kreskowiak16-Aug-14 4:29
mvpDave Kreskowiak16-Aug-14 4:29 
GeneralRe: Missing TCP Packets Pin
M Riaz Bashir16-Aug-14 19:54
memberM Riaz Bashir16-Aug-14 19:54 
AnswerRe: Missing TCP Packets Pin
Rob Philpott16-Aug-14 6:34
professionalRob Philpott16-Aug-14 6:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.160929.1 | Last Updated 1 Oct 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid