Solved

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

Posted on 2006-10-27
7
168 Views
Last Modified: 2010-04-23
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
Comment
Question by:indy500fan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 17822811
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
 

Author Comment

by:indy500fan
ID: 17822873
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
 
LVL 13

Expert Comment

by:newyuppie
ID: 17822901
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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 13

Expert Comment

by:newyuppie
ID: 17822904
NEVER MIND FOR GODS SAKE what i wrote...
0
 

Author Comment

by:indy500fan
ID: 17822920
:) Okay newyuppie.  Sounds like you've had a hard day too.
0
 
LVL 11

Accepted Solution

by:
LordWabbit earned 500 total points
ID: 17825120
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
 

Author Comment

by:indy500fan
ID: 17834612
LordWabbit,

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question