Click here to Skip to main content
15,916,945 members
Home / Discussions / C#
   

C#

 
Questionhourglass mouse still clicking Pin
lushgrass6-Jul-06 19:53
lushgrass6-Jul-06 19:53 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi6-Jul-06 20:38
Nader Elshehabi6-Jul-06 20:38 
GeneralRe: hourglass mouse still clicking Pin
lushgrass6-Jul-06 21:02
lushgrass6-Jul-06 21:02 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi6-Jul-06 21:22
Nader Elshehabi6-Jul-06 21:22 
GeneralRe: hourglass mouse still clicking Pin
lushgrass6-Jul-06 22:24
lushgrass6-Jul-06 22:24 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi6-Jul-06 22:58
Nader Elshehabi6-Jul-06 22:58 
GeneralRe: hourglass mouse still clicking Pin
lushgrass6-Jul-06 23:21
lushgrass6-Jul-06 23:21 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi7-Jul-06 2:46
Nader Elshehabi7-Jul-06 2:46 
Hello

Forgive me if I say that your code has some mistakesBlush | :O . One of them is that you don't really recognize the scope of objects. if you declare an object in one method, it's destroyed & goes out of scope once the method is over -well, there are more details on this subject-.

Also you must add an event handler for your event to be handled by a method -notice the += operator below-

I'll assume that MyClass is your class, & it's driven from System.Windows.From

class MyClass : Form
        {
            Control Dummy;
            bool busy;
            MyClass()
            {
                Dummy = new Control();
                busy = false;
                Dummy.MouseCaptureChanged += new EventHandler(Dummy_MouseCaptureChanged);
            }

            public void MyLongMethod()
            {
                busy = true;
                Dummy.Capture = true;
                UseWaitCursor = true;

                // TODO: Add your code here

                busy = false;
                Dummy.Capture = false;
                UseWaitCursor = false;
            }

            void Dummy_MouseCaptureChanged(object sender, EventArgs e)
            {
                if (busy)
                    Dummy.Capture = true;
            }
        }


Happy programmingRose | [Rose]
GeneralRe: hourglass mouse still clicking [modified] Pin
lushgrass9-Jul-06 16:59
lushgrass9-Jul-06 16:59 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi9-Jul-06 20:49
Nader Elshehabi9-Jul-06 20:49 
GeneralRe: hourglass mouse still clicking Pin
lushgrass9-Jul-06 23:26
lushgrass9-Jul-06 23:26 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi9-Jul-06 23:40
Nader Elshehabi9-Jul-06 23:40 
GeneralRe: hourglass mouse still clicking Pin
lushgrass9-Jul-06 23:48
lushgrass9-Jul-06 23:48 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi10-Jul-06 1:42
Nader Elshehabi10-Jul-06 1:42 
GeneralRe: hourglass mouse still clicking [modified] Pin
lushgrass12-Jul-06 16:22
lushgrass12-Jul-06 16:22 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi12-Jul-06 22:43
Nader Elshehabi12-Jul-06 22:43 
GeneralRe: hourglass mouse still clicking [modified] Pin
lushgrass13-Jul-06 0:51
lushgrass13-Jul-06 0:51 
AnswerRe: hourglass mouse still clicking [modified] Pin
Nader Elshehabi13-Jul-06 3:08
Nader Elshehabi13-Jul-06 3:08 
GeneralRe: hourglass mouse still clicking Pin
lushgrass13-Jul-06 4:02
lushgrass13-Jul-06 4:02 
GeneralRe: hourglass mouse still clicking Pin
Nader Elshehabi13-Jul-06 10:45
Nader Elshehabi13-Jul-06 10:45 
GeneralRe: hourglass mouse still clicking Pin
lushgrass13-Jul-06 23:44
lushgrass13-Jul-06 23:44 
QuestionRe: hourglass mouse still clicking [modified] Pin
lushgrass16-Jul-06 21:24
lushgrass16-Jul-06 21:24 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi19-Jul-06 21:14
Nader Elshehabi19-Jul-06 21:14 
QuestionDetecting CTL+M Pin
picasso26-Jul-06 19:09
picasso26-Jul-06 19:09 
AnswerRe: Detecting CTL+M Pin
stancrm6-Jul-06 20:17
stancrm6-Jul-06 20:17 

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.