Hey all,
Im a recent convert to VB2008 Express from VB6.0 Enterprise [1.5 days now]
Anyway, the program im writing has a graph, which i want to fade in (most recent data brighter)
in vb6 i would use something like
Ive highlighted the bit im struggling with in VB2008, from what ive read on MSDN, and the really crap help file included with VB it seems I need to:
create a brush
create a pen from the brush
draw a line
destroy the pen
destroy the brush
REPEAT 150 times
surely this cant be right, i just want to use a custom color for my line, I can use a built in color without problem, but i need to be able to specify RGB values.
Here is the line of code i have for VB2008:
The bold bit is the problem, i have tried color.fromARGB(105+AccelChartX,0,0) but it didnt work.
2nd issue, Send Input.
I have been searching for the easiest way to impliment SendInput API. I need to inject key up, and key down messages into the the keyboard buffer.
All the examples i have found have all the code for mouse input blended into into the example or are mouse only. Im looking for the simplest solution that will let me inject keystrokes {F1} {F2} etc into the input stream AS EARLY AS POSSIBLE so that they can be processed as if physically typed on the keyboard (im open to alternatives to sendinput, but need it to work way upstream)
Sorry for the long post, but I hoped to give potential helpers as much info as possible.
Regards
:thumb:Gangsta
Im a recent convert to VB2008 Express from VB6.0 Enterprise [1.5 days now]
Anyway, the program im writing has a graph, which i want to fade in (most recent data brighter)
in vb6 i would use something like
Code:
for x=1 to 149
picbox.line(x-1,data(x-1))-(x,data(x)), [B]rgb(105 + x,0,0)[/B]
next x
Ive highlighted the bit im struggling with in VB2008, from what ive read on MSDN, and the really crap help file included with VB it seems I need to:
create a brush
create a pen from the brush
draw a line
destroy the pen
destroy the brush
REPEAT 150 times
surely this cant be right, i just want to use a custom color for my line, I can use a built in color without problem, but i need to be able to specify RGB values.
Here is the line of code i have for VB2008:
Code:
e.Graphics.DrawLine([B]Pens.Red[/B], AccelChartX - 1, 40 - AccelChartPrevX, AccelChartX, 40 - AccelChartTempX)
The bold bit is the problem, i have tried color.fromARGB(105+AccelChartX,0,0) but it didnt work.
2nd issue, Send Input.
I have been searching for the easiest way to impliment SendInput API. I need to inject key up, and key down messages into the the keyboard buffer.
All the examples i have found have all the code for mouse input blended into into the example or are mouse only. Im looking for the simplest solution that will let me inject keystrokes {F1} {F2} etc into the input stream AS EARLY AS POSSIBLE so that they can be processed as if physically typed on the keyboard (im open to alternatives to sendinput, but need it to work way upstream)
Sorry for the long post, but I hoped to give potential helpers as much info as possible.
Regards
:thumb:Gangsta