Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
GeneralRe: PointToClient and PointToScreen Pin
Jay Shankar8-Dec-04 18:45
Jay Shankar8-Dec-04 18:45 
GeneralRe: PointToClient and PointToScreen Pin
Anonymous8-Dec-04 18:47
Anonymous8-Dec-04 18:47 
GeneralRe: PointToClient and PointToScreen Pin
Jay Shankar8-Dec-04 18:52
Jay Shankar8-Dec-04 18:52 
GeneralRe: PointToClient and PointToScreen Pin
Anonymous8-Dec-04 19:02
Anonymous8-Dec-04 19:02 
GeneralRe: PointToClient and PointToScreen Pin
Jay Shankar8-Dec-04 19:14
Jay Shankar8-Dec-04 19:14 
GeneralRe: PointToClient and PointToScreen Pin
Tyrus1828-Dec-04 19:19
Tyrus1828-Dec-04 19:19 
GeneralRe: PointToClient and PointToScreen Pin
Jay Shankar8-Dec-04 19:54
Jay Shankar8-Dec-04 19:54 
GeneralRe: PointToClient and PointToScreen Pin
Alex Korchemniy8-Dec-04 21:10
Alex Korchemniy8-Dec-04 21:10 
Im not going to give you a code solution. Here is how you do it (psuedo-code straight from my head, hopefully no mistakes):

Point originalFormLocation;
Point originalMouseDownLocation;
bool state;
onMouseDown()
{
  // save original screen coordinates of form
  // save original screen coordinates of mouse
  state = moving;
}

onMouseMove()
{
 if (state = moving)
 {
   // get current screen coordinated of mouse
   // calculate offset
   // apply offset to original form location
   // set form location
 }
}

onMouseUp()
{
  // reset state
}


Note: you're always working with screen coordinates.

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

Alex Korchemniy
GeneralRe: PointToClient and PointToScreen Pin
Jay Shankar8-Dec-04 21:20
Jay Shankar8-Dec-04 21:20 
GeneralRe: PointToClient and PointToScreen Pin
Alex Korchemniy8-Dec-04 21:26
Alex Korchemniy8-Dec-04 21:26 
GeneralRe: PointToClient and PointToScreen Pin
Jay Shankar8-Dec-04 22:31
Jay Shankar8-Dec-04 22:31 
GeneralBurning Data CDs Pin
miracle_monster8-Dec-04 16:40
miracle_monster8-Dec-04 16:40 
GeneralRe: Burning Data CDs Pin
Alex Korchemniy8-Dec-04 18:39
Alex Korchemniy8-Dec-04 18:39 
GeneralRe: Burning Data CDs Pin
miracle_monster9-Dec-04 10:12
miracle_monster9-Dec-04 10:12 
GeneralRe: Burning Data CDs Pin
Alex Korchemniy9-Dec-04 10:29
Alex Korchemniy9-Dec-04 10:29 
Questionhow to validate all the textbox in the Form Pin
kings_18-Dec-04 12:05
kings_18-Dec-04 12:05 
AnswerRe: how to validate all the textbox in the Form Pin
Alex Korchemniy8-Dec-04 12:44
Alex Korchemniy8-Dec-04 12:44 
GeneralAn inherited control on a form that will be inherited Pin
Jochen Jonckheere8-Dec-04 11:45
Jochen Jonckheere8-Dec-04 11:45 
GeneralRe: An inherited control on a form that will be inherited Pin
Alex Korchemniy8-Dec-04 12:03
Alex Korchemniy8-Dec-04 12:03 
GeneralRe: An inherited control on a form that will be inherited Pin
Jochen Jonckheere8-Dec-04 19:55
Jochen Jonckheere8-Dec-04 19:55 
GeneralRe: An inherited control on a form that will be inherited Pin
Alex Korchemniy8-Dec-04 20:48
Alex Korchemniy8-Dec-04 20:48 
GeneralWMI Pin
john kuruvila8-Dec-04 8:28
john kuruvila8-Dec-04 8:28 
GeneralRe: WMI Pin
Alex Korchemniy8-Dec-04 9:44
Alex Korchemniy8-Dec-04 9:44 
QuestionParsing Source in C#/NET? Pin
McClamm8-Dec-04 8:21
McClamm8-Dec-04 8:21 
AnswerRe: Parsing Source in C#/NET? Pin
Javier Lozano8-Dec-04 10:10
Javier Lozano8-Dec-04 10:10 

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.