Forum  Commercial Foru...  Commercial Foru...  The designer is putting a "bad" event handles into the code.
Previous Previous
 
Next Next
New Post 5/3/2011 7:58 AM
  sramirez@dynacal.com
508 posts
1st Level Poster


The designer is putting a "bad" event handles into the code. 

I have a form with a user control which has an event called "ResourcesChanged(List as List(of Resources))"

In my form, I handle this with the following code:

    Private Sub ucResources_ResourcesChanged(ByVal Resources As System.Collections.Generic.List(Of EventResource)) Handles ucResources.ResourcesChanged
        mEvent.EventResourceList = Resources
    End Sub

If I compile and run my app the event handler works fine and when I change a resource it fires correctly.

If I go into the editor and change something (move a control a few pixels for instance), when I save I get the following added:

Private Sub ucResources_ResourcesChanged( ByVal Resources As System.Collections.Generic.List`1)

    End Sub

What am I doing wrong that this is happening?

Thanks,

Shawn

 
New Post 5/3/2011 4:33 PM
  palli
14298 posts
1st Level Poster




Re: The designer is putting a "bad" event handles into the code. 

Hi Shawn,

Try making the event declaration in your usercontrol, and the event handler in your code to be of the same signature.

Your UserControl's event declaration is List(Of Resources), while your event handler in your form is List(Of EventResource).

See if that helps,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 5/3/2011 6:12 PM
  sramirez@dynacal.com
508 posts
1st Level Poster


Re: The designer is putting a "bad" event handles into the code. 

I am sorry, I mis-typed in the code into my forum post.  They are both List(of EventResource).

But I still don't understand something.  Why does the generator try to add the sub that handles the event?  And why does it add it with the funny parameter:

Private Sub ucResources_ResourcesChanged( ByVal Resources As System.Collections.Generic.List`1)

    End Sub

 

And the sub doesn't have the "Handles ucResources.ResourcesChanged" on it.

Shawn

Thanks,

 
New Post 5/3/2011 6:20 PM
  palli
14298 posts
1st Level Poster




Re: The designer is putting a "bad" event handles into the code. 

Hi Shawn,

Not sure why it does, and I can't reproduce this here.

Please try to create the most minimal reproducing sample application and email to support following the usual procedures.

Also, please state clearly what Visual WebGui version and whan Visual Studio version you are using.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 5/3/2011 6:24 PM
  sramirez@dynacal.com
508 posts
1st Level Poster


Re: The designer is putting a "bad" event handles into the code. 

I knew you were going to say that :)

I will see if i can reproduce it, it only happens in this one instance.

I am using 6.4b and VS2010

Thanks,

Shawn

 
Previous Previous
 
Next Next
  Forum  Commercial Foru...  Commercial Foru...  The designer is putting a "bad" event handles into the code.
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS