Click here to Skip to main content
15,906,081 members
Home / Discussions / C#
   

C#

 
AnswerRe: How can i load a program autimatically when windows loaded Pin
Dave Kreskowiak8-Jun-07 14:23
mveDave Kreskowiak8-Jun-07 14:23 
GeneralRe: How can i load a program autimatically when windows loaded Pin
Hesham Yassin10-Jun-07 1:37
Hesham Yassin10-Jun-07 1:37 
GeneralRe: How can i load a program autimatically when windows loaded Pin
Dave Kreskowiak10-Jun-07 17:31
mveDave Kreskowiak10-Jun-07 17:31 
GeneralRe: How can i load a program autimatically when windows loaded Pin
Hesham Yassin10-Jun-07 22:13
Hesham Yassin10-Jun-07 22:13 
GeneralRe: How can i load a program autimatically when windows loaded Pin
originSH10-Jun-07 23:27
originSH10-Jun-07 23:27 
GeneralRe: How can i load a program autimatically when windows loaded Pin
Dave Kreskowiak11-Jun-07 2:34
mveDave Kreskowiak11-Jun-07 2:34 
GeneralRe: How can i load a program autimatically when windows loaded Pin
originSH12-Jun-07 1:00
originSH12-Jun-07 1:00 
QuestionFocus lost when dragging a button Pin
AtomRiot8-Jun-07 12:47
AtomRiot8-Jun-07 12:47 
ok, i have a button that i am dragging around. this much i can handle, but then i thought i would put it on a panel (like change the parent attribute) until the time came to use it and then when the button was clicked, it would set the parent to the main form (this)

the issue is when I do this, i can drag the button around ok if i drag very slowly, if i go to fast, the mouse comes off the button and the button no longer drags.

here is the main code. It uses a panel named panel1 and a button named button1

namespace focus_test
{
    public partial class Form1 : Form
    {
        int xOffset, yOffset;
        bool buttonClicked;
        public Form1()
        {
            xOffset = yOffset = 0;
            buttonClicked = false;
            InitializeComponent();
        }

        private void button1_MouseDown(object sender, MouseEventArgs e)
        {
            xOffset = e.X;
            yOffset = e.Y;
            buttonClicked = true;

            if (button1.Parent != this)
            {
                button1.Parent = this;
                button1.Left += panel1.Left;
                button1.Top += panel1.Top;
            }            
            button1.BringToFront();
        }

        private void button1_MouseUp(object sender, MouseEventArgs e)
        {
            buttonClicked = false;
        }

        private void button1_MouseMove(object sender, MouseEventArgs e)
        {
            if (buttonClicked)
            {
                button1.Left += (e.X - xOffset);
                button1.Top += (e.Y - yOffset);
            }
        }
    }
}


to see what i am seeing, click on the button and hold down the mouse and drag it around. Going too fast (using the term "fast" loosely) the mouse will end up not over the piece any longer and not send a mouse move message to it anymore.

but

if you go over the button and let go of your mouse then click and drag again, you can go as fast as you want like the poor little mouse is welded to the button.

anyone got any clues as to why this is so?

"Details details. Things to do Things to get done. Don't bother me with details just tell me when they're done." James Price

AnswerRe: Focus lost when dragging a button Pin
Guffa8-Jun-07 13:24
Guffa8-Jun-07 13:24 
GeneralRe: Focus lost when dragging a button Pin
AtomRiot8-Jun-07 14:00
AtomRiot8-Jun-07 14:00 
GeneralRe: Focus lost when dragging a button Pin
Guffa8-Jun-07 22:36
Guffa8-Jun-07 22:36 
GeneralRe: Focus lost when dragging a button Pin
AtomRiot9-Jun-07 20:53
AtomRiot9-Jun-07 20:53 
GeneralRe: Focus lost when dragging a button Pin
Guffa10-Jun-07 0:30
Guffa10-Jun-07 0:30 
GeneralRe: Focus lost when dragging a button Pin
AtomRiot10-Jun-07 8:16
AtomRiot10-Jun-07 8:16 
AnswerRe: Focus lost when dragging a button Pin
Guffa13-Jun-07 7:21
Guffa13-Jun-07 7:21 
QuestionWinForm control extenders Pin
martin_hughes8-Jun-07 11:12
martin_hughes8-Jun-07 11:12 
AnswerRe: WinForm control extenders Pin
Marco Bertschi20-Nov-12 1:27
protectorMarco Bertschi20-Nov-12 1:27 
QuestionHow to add an Icon into RichTextBox like in Messenger Pin
Hesham Yassin8-Jun-07 10:51
Hesham Yassin8-Jun-07 10:51 
QuestionHow to auto download updates and install Pin
Agyeman8-Jun-07 10:43
Agyeman8-Jun-07 10:43 
AnswerRe: How to auto download updates and install Pin
Not Active8-Jun-07 10:57
mentorNot Active8-Jun-07 10:57 
GeneralRe: How to auto download updates and install Pin
Kevin McFarlane8-Jun-07 11:03
Kevin McFarlane8-Jun-07 11:03 
QuestionMerge cells in word 2003 Pin
Larza1238-Jun-07 9:50
Larza1238-Jun-07 9:50 
AnswerRe: Merge cells in word 2003 Pin
Goalie358-Jun-07 10:27
Goalie358-Jun-07 10:27 
GeneralRe: Merge cells in word 2003 Pin
Larza12315-Jul-07 23:56
Larza12315-Jul-07 23:56 
AnswerRe: Merge cells in word 2003 Pin
wowo60823-Apr-09 0:07
wowo60823-Apr-09 0: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.