• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

What the!?! - My Handles are getting deleted!!!

Friends,

I think I have found a bug with Visual Studio 2005.  I have a block of code, and it so happens that it is in this code that I specifically created a Handles statement.  Now, if I save this change (adding the Handles), and then go to the form (where this code is a part of it), and make a change to the form (Designer), when I come back, my handles is deleted!!!

What's this about?  Now the handles that were created by the environment, like a button click, they stay, but the handles that I create are deleated.  What's wrong?

Before making a change to the form in designer:

    Private Sub TimerEventProcessor(ByVal myObject As Object, _
        ByVal myEventArgs As EventArgs) Handles myTimer.Tick
        ' stop the timer and hide the form
        tmrShowMainForm.Stop()
        Me.WindowState = FormWindowState.Minimized
    End Sub

After making a change:

    Private Sub TimerEventProcessor(ByVal myObject As Object, _
        ByVal myEventArgs As EventArgs)
        ' stop the timer and hide the form
        tmrShowMainForm.Stop()
        Me.WindowState = FormWindowState.Minimized
    End Sub

Without that Handles, it never stops and my form never minimizes.

Thanks in advance!

Regards,
Eric
0
indy500fan
Asked:
indy500fan
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
What exactly are you saying here?...

That after you have added "Handles myTimer.Tick" and saved the project, it is somehow being deleted again by the IDE?
0
 
indy500fanAuthor Commented:
Hey Idle_Mind, haven't talked to you in a while.  ;)

That is exactly what I am saying.  It is crazy, and that is why I was having so hard a time yesterday when you were helping me.  The thing I need to check (though it won't be till monday now - left my laptop at the office), is to see if my test app, in the same IDE, reacts the same way.

Weird huh!?!

Eric
0
 
newyuppieCommented:
Private Sub TimerEventProcessor(ByVal myObject As Object, _
        ByVal myEventArgs As EventArgs)

try changing the parameters to

Private Sub TimerEventProcessor(ByVal myObject As Object, _
        ByVal myEventArgs As SystemEventArgs)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
newyuppieCommented:
NEVER MIND FOR GODS SAKE what i wrote...
0
 
indy500fanAuthor Commented:
:) Okay newyuppie.  Sounds like you've had a hard day too.
0
 
LordWabbitCommented:
i know that the ide has a penchant to remove handles when you move controls in and out of containers (like group boxes) perhaps when working with other form objects it decides this one should be removed as well.
0
 
indy500fanAuthor Commented:
LordWabbit,

Is there anything I can do to prevent this, or is using Handles now what Microsoft deems as poor practices?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now