Click here to Skip to main content
16,005,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: Application Deployment Pin
BlitzPackage22-Jul-08 8:05
BlitzPackage22-Jul-08 8:05 
GeneralRe: Application Deployment Pin
Garrett Pauls22-Jul-08 8:25
Garrett Pauls22-Jul-08 8:25 
GeneralRe: Application Deployment Pin
BlitzPackage22-Jul-08 8:54
BlitzPackage22-Jul-08 8:54 
GeneralRe: Application Deployment Pin
selcuks24-Jul-08 21:04
selcuks24-Jul-08 21:04 
QuestionClass Cleanup Challenge Pin
lisad_tgc22-Jul-08 5:53
lisad_tgc22-Jul-08 5:53 
AnswerRe: Class Cleanup Challenge Pin
Anthony Mushrow22-Jul-08 5:56
professionalAnthony Mushrow22-Jul-08 5:56 
QuestionMultithreading and XML DOM Pin
Justin Time22-Jul-08 5:14
Justin Time22-Jul-08 5:14 
QuestionMouseMove event not firing for newly added control [modified] Pin
Michael Dausmann22-Jul-08 4:59
Michael Dausmann22-Jul-08 4:59 
I want to create a control on the form when the MouseDown event on the form fires and then use the MouseMove event on the newly created control to drag the control around the form. Unfortunately the MouseMove event doesn't appear to fire on the new control until the mouse button is released! ... This is the simplest cut down of the issue I could create.

private void button1_MouseMove(object sender, MouseEventArgs e)
{
    this.Text = "Button: e.x=" + e.X.ToString() + " e.y=" + e.Y;
}
private void Form2_MouseMove(object sender, MouseEventArgs e)
{
    this.Text = "Form: e.x=" + e.X.ToString() + " e.y=" + e.Y;
}
private void Form2_MouseDown(object sender, MouseEventArgs e)
{
    Button button1 = new System.Windows.Forms.Button();
    this.SuspendLayout();
    button1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.button1_MouseMove);
    this.Controls.Add(button1);
    this.ResumeLayout(false);
}


Is it possible to 'wire up' the MouseMove event so that it will fire on the new control before the mouse button is released ?

Michael

modified on Tuesday, July 22, 2008 11:35 AM

AnswerRe: MouseMove event not firing for newly added control Pin
half-life22-Jul-08 7:50
half-life22-Jul-08 7:50 
GeneralRe: MouseMove event not firing for newly added control Pin
Michael Dausmann22-Jul-08 12:15
Michael Dausmann22-Jul-08 12:15 
AnswerThe Answer! Use Capture=false.. Re: MouseMove event not firing for newly added control Pin
Michael Dausmann22-Jul-08 13:56
Michael Dausmann22-Jul-08 13:56 
QuestionIs it possible to make this routine automatic? Pin
But_Im_a_Lady22-Jul-08 4:53
But_Im_a_Lady22-Jul-08 4:53 
AnswerRe: Is it possible to make this routine automatic? Pin
Luc Pattyn22-Jul-08 5:25
sitebuilderLuc Pattyn22-Jul-08 5:25 
GeneralRe: Is it possible to make this routine automatic? Pin
But_Im_a_Lady22-Jul-08 20:30
But_Im_a_Lady22-Jul-08 20:30 
AnswerRe: Is it possible to make this routine automatic? Pin
Michael Dausmann22-Jul-08 5:34
Michael Dausmann22-Jul-08 5:34 
GeneralRe: Is it possible to make this routine automatic? Pin
But_Im_a_Lady22-Jul-08 20:33
But_Im_a_Lady22-Jul-08 20:33 
Question.net 2.0 windows - treeview Pin
arkiboys22-Jul-08 4:36
arkiboys22-Jul-08 4:36 
AnswerRe: .net 2.0 windows - treeview Pin
half-life22-Jul-08 7:57
half-life22-Jul-08 7:57 
GeneralRe: .net 2.0 windows - treeview Pin
arkiboys22-Jul-08 10:21
arkiboys22-Jul-08 10:21 
GeneralRe: .net 2.0 windows - treeview Pin
half-life23-Jul-08 10:24
half-life23-Jul-08 10:24 
GeneralRe: .net 2.0 windows - treeview Pin
arkiboys23-Jul-08 10:52
arkiboys23-Jul-08 10:52 
GeneralRe: .net 2.0 windows - treeview Pin
half-life23-Jul-08 19:33
half-life23-Jul-08 19:33 
QuestionControl Hardware through Software Pin
thund3rstruck22-Jul-08 4:00
thund3rstruck22-Jul-08 4:00 
AnswerRe: Control Hardware through Software Pin
stancrm22-Jul-08 4:05
stancrm22-Jul-08 4:05 
GeneralRe: Control Hardware through Software Pin
thund3rstruck22-Jul-08 4:15
thund3rstruck22-Jul-08 4:15 

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.