Click here to Skip to main content
15,917,795 members
Home / Discussions / C#
   

C#

 
QuestionGenerate AxInterop files Pin
Laurent.iss6-Jul-07 3:29
Laurent.iss6-Jul-07 3:29 
QuestionUpdate designer after updating a property Pin
Christopher Stratmann6-Jul-07 3:06
Christopher Stratmann6-Jul-07 3:06 
AnswerRe: Update designer after updating a property Pin
snorkie6-Jul-07 4:14
professionalsnorkie6-Jul-07 4:14 
GeneralRe: Update designer after updating a property Pin
Christopher Stratmann6-Jul-07 4:28
Christopher Stratmann6-Jul-07 4:28 
AnswerRe: Update designer after updating a property Pin
Martin#6-Jul-07 6:57
Martin#6-Jul-07 6:57 
QuestionTool tip text in a button Pin
-spy-6-Jul-07 2:45
-spy-6-Jul-07 2:45 
AnswerRe: Tool tip text in a button Pin
kubben6-Jul-07 2:56
kubben6-Jul-07 2:56 
QuestionGDI: Move Rect. using KeyDown/Up and Timer Pin
oliiix6-Jul-07 2:31
oliiix6-Jul-07 2:31 
I'd like to move a Rectangle drawn over a form with the w,s,a,d keys. With the following code it works just fine:

private void Form1_KeyDown(object sender, KeyEventArgs kea)
{
kea.Handled = true;
if (kea.KeyData == Keys.A)
{
graphics.DrawRectangle(myPen_del, a, b, 30, 30);
a -= 4;
graphics.DrawRectangle(myPen, a, b, 30, 30);
}
}

(myPen.Color = black; myPen_del.Color = gray)

But: If I click a.e. 'a' and afterwards 'w', the rectangle i'm moving stucks a bit. That has to do with the windows timer (repeat delay / repeat rate).

What I don't know is how to calculate through KeyDown/Up Event what Keys are pressed and set a selfmade Timer so that the rectangle I'm moving flows and doesn't get stuck every time I'm pressing another button on the keyboard.

Has anyone got a good tutorial for this? Or some sample code about it? I will also gonna include moving the rect in 45° angle by pressing as example 'a' & 'w' together.

By this I will only draw my rectangle in the OnPaint-Event. So can anyone tell me how to manually launch the OnPaint-Event? Cause when I'm doing a Form.Refresh() my integers a and b will be resetted to Wink | ;) I was really searching alot for this problem but haven't found anywhere something really helpful Frown | :(

Hope you understood my question and thank you very much in advance for looking into it Smile | :)
AnswerRe: GDI: Move Rect. using KeyDown/Up and Timer Pin
Luc Pattyn6-Jul-07 2:57
sitebuilderLuc Pattyn6-Jul-07 2:57 
GeneralRe: GDI: Move Rect. using KeyDown/Up and Timer Pin
oliiix6-Jul-07 3:56
oliiix6-Jul-07 3:56 
GeneralRe: GDI: Move Rect. using KeyDown/Up and Timer Pin
Luc Pattyn6-Jul-07 4:09
sitebuilderLuc Pattyn6-Jul-07 4:09 
AnswerRe: GDI: Move Rect. using KeyDown/Up and Timer Pin
oliiix6-Jul-07 4:20
oliiix6-Jul-07 4:20 
QuestionHow to set The Break point Condition in vs.NET Pin
Hum Dum6-Jul-07 2:20
Hum Dum6-Jul-07 2:20 
AnswerRe: How to set The Break point Condition in vs.NET Pin
kubben6-Jul-07 2:51
kubben6-Jul-07 2:51 
QuestionDialog event Pin
Maddie from Dartford6-Jul-07 1:59
Maddie from Dartford6-Jul-07 1:59 
AnswerRe: Dialog event Pin
Pete O'Hanlon6-Jul-07 2:02
mvePete O'Hanlon6-Jul-07 2:02 
AnswerRe: Dialog event Pin
Martin#6-Jul-07 2:04
Martin#6-Jul-07 2:04 
AnswerRe: Dialog event Pin
Chintan.Desai6-Jul-07 2:13
Chintan.Desai6-Jul-07 2:13 
QuestionNeed Suggestion for best Component Library for C# Pin
logikos6-Jul-07 1:43
logikos6-Jul-07 1:43 
AnswerRe: Need Suggestion for best Component Library for C# Pin
Pete O'Hanlon6-Jul-07 2:01
mvePete O'Hanlon6-Jul-07 2:01 
GeneralRe: Need Suggestion for best Component Library for C# Pin
logikos6-Jul-07 2:24
logikos6-Jul-07 2:24 
GeneralRe: Need Suggestion for best Component Library for C# Pin
Joseph Guadagno6-Jul-07 4:34
Joseph Guadagno6-Jul-07 4:34 
Questionmouse position + map lon/lat C# Pin
mercenary016-Jul-07 1:41
mercenary016-Jul-07 1:41 
AnswerRe: mouse position + map lon/lat C# Pin
Martin#6-Jul-07 1:47
Martin#6-Jul-07 1:47 
GeneralRe: mouse position + map lon/lat C# Pin
mercenary016-Jul-07 1:48
mercenary016-Jul-07 1:48 

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.