Click here to Skip to main content
15,921,646 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem with SendMessage() using P/Invoke Pin
Liu Shuai8-Dec-04 5:22
Liu Shuai8-Dec-04 5:22 
GeneralRe: Problem with SendMessage() using P/Invoke Pin
Mike Dimmick8-Dec-04 0:10
Mike Dimmick8-Dec-04 0:10 
GeneralRe: Problem with SendMessage() using P/Invoke Pin
Liu Shuai8-Dec-04 4:09
Liu Shuai8-Dec-04 4:09 
GeneralHELP ME!!! Pin
Jacob Graves7-Dec-04 13:44
Jacob Graves7-Dec-04 13:44 
GeneralRe: HELP ME!!! Pin
Heath Stewart7-Dec-04 14:51
protectorHeath Stewart7-Dec-04 14:51 
GeneralSorry.. Pin
Jacob Graves7-Dec-04 15:10
Jacob Graves7-Dec-04 15:10 
GeneralRe: Sorry.. Pin
Jitesh Patil7-Dec-04 21:53
Jitesh Patil7-Dec-04 21:53 
GeneralRe: Sorry.. Pin
Heath Stewart8-Dec-04 5:51
protectorHeath Stewart8-Dec-04 5:51 
Never store a Graphics object as a field. You either create a temporary Graphics object with CreateGraphics or - when overring OnPaint or handling the Paint event of a different control - use PaintEventArgs.Graphics. Do not store these ever.

The other reply is asking the right question: why are you re-instantiating Graph? It's that object you should be referencing in a field.

The other thing you need to do is read about the MousePosition static property. This returns the screen position - not the client (your control) position, i.e. relative to your control's upper-left coordinate (always 0,0). To translate the coordinates, call Control.PointToClient (reads the SDK documentation that was installed by default when you install VS.NET or the .NET Framework SDK; it's also available online at http://msdn.microsoft.com/library[^]) the compare the coordinates.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralThank you! Pin
Jacob Graves8-Dec-04 7:29
Jacob Graves8-Dec-04 7:29 
GeneralRe: Installing my program on other computers... Pin
Skynyrd7-Dec-04 13:21
Skynyrd7-Dec-04 13:21 
GeneralRe: Installing my program on other computers... Pin
Heath Stewart7-Dec-04 13:32
protectorHeath Stewart7-Dec-04 13:32 
GeneralRe: Installing my program on other computers... Pin
Moochie57-Dec-04 13:36
Moochie57-Dec-04 13:36 
GeneralRe: Installing my program on other computers... Pin
exhaulted7-Dec-04 23:18
exhaulted7-Dec-04 23:18 
GeneralRe: Installing my program on other computers... Pin
Daniel Turini8-Dec-04 1:38
Daniel Turini8-Dec-04 1:38 
GeneralInstalling my program on other computers... Pin
Moochie57-Dec-04 13:14
Moochie57-Dec-04 13:14 
QuestionCombobox in C# : how to add for each Item a Tag ? Pin
youssef7-Dec-04 12:42
youssef7-Dec-04 12:42 
AnswerRe: Combobox in C# : how to add for each Item a Tag ? Pin
Skynyrd7-Dec-04 13:29
Skynyrd7-Dec-04 13:29 
AnswerRe: Combobox in C# : how to add for each Item a Tag ? Pin
Heath Stewart7-Dec-04 14:47
protectorHeath Stewart7-Dec-04 14:47 
AnswerRe: Combobox in C# : how to add for each Item a Tag ? Pin
Luis Alonso Ramos8-Dec-04 21:24
Luis Alonso Ramos8-Dec-04 21:24 
GeneralDynamicInvoke a remote object Pin
Skynyrd7-Dec-04 12:21
Skynyrd7-Dec-04 12:21 
GeneralRe: DynamicInvoke a remote object Pin
Heath Stewart7-Dec-04 14:48
protectorHeath Stewart7-Dec-04 14:48 
GeneralRe: DynamicInvoke a remote object Pin
Skynyrd8-Dec-04 0:57
Skynyrd8-Dec-04 0:57 
GeneralRe: DynamicInvoke a remote object Pin
Javier Lozano7-Dec-04 15:02
Javier Lozano7-Dec-04 15:02 
GeneralRe: DynamicInvoke a remote object Pin
Skynyrd8-Dec-04 1:08
Skynyrd8-Dec-04 1:08 
GeneralRe: DynamicInvoke a remote object Pin
Javier Lozano8-Dec-04 5:07
Javier Lozano8-Dec-04 5:07 

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.