Question event handling in c# component through dll using vb.net

bldieff

New member
Joined
Dec 15, 2011
Messages
3
Programming Experience
1-3
I've been trying to figure out how to get this control to work for over a week. It can be found here: A Professional Calendar/Agenda View That You Will Use - CodeProject. It's a calendar/scheduler control that was designed using c# and I'm trying to use it in my vb.net app. I've sucessfully created a dll and have referenced that dll in my project and am able to see the controls in the toolbox as well as put them on my form. My problem is that I can't get ANY of the code that I wrote in the form to fire. No event handlers will work, not even the form_load which handles the mybase.load event. Nada. Can anyone think of a reason that this might be? How do I sucessfully add a handler to the events? I've used
<code> addhandler monthView1.SelectionChanged, addressof (and nothing I put here ever works) </code>

I've also tried to do it through "handles", but that doesn't work either because nothing is executing in my form. Please HELP!! :)

Thanks in advance.
 
A control is a control so, in theory, working with this control is no different to working with a Button or a TextBox. Create a new WinForms project and add an instance of this control to your form from the Toolbox. Select the control, open the Properties window and click the Events button. Now double-click the event of interest. That should generate a handler for the event with your control in the Handles clause. You can also use the drop-downs at the top of the code window to generate an event handler by selecting the control on the left and the event on the right.
 
Thanks for your reply. I never knew about the events button, so thank you. However, everything is already listed in the events properties window, but still not working.

I've also tried to insert a handler via the way you suggested in the code. This is what I had:

PrivateSub monthView1_SelectionChanged(sender AsObject, e AsEventArgs) Handles monthView1.SelectionChanged
calendar1.SetViewRange(monthView1.SelectionStart, monthView1.SelectionEnd)
EndSub

but that isn't ever hitting during execution; any other suggestions?
 
As it turns out, it was one line of code...2 weeks...one line. I had converted the demo from c# to vb.net and copied and pasted into the form, then modified everything that I needed. I didn't take out the "namespace" line. After deleting that, it was good. Thanks for your effort!
"
 
Back
Top