Custom controls

  • Thread starter Thread starter Nathan
  • Start date Start date
N

Nathan

Hi,

I've created a custom control which until now has been working okay in my
project. I'm having difficulty getting events to fire on it. I added a new
control to the form with a MouseDown event, and nothing happens when I click
on it when the project is run. The UserControl consists of three
different-colored labels, an enumeration, some properties, a context menu,
and some MouseEnter and MouseLeave events that highlight the control. All
these work fine when an instance of this control is added to a form, but I
can't get any other events to fire from the form. Any suggestions?

Thanks,
Nathan
 
when u instantiate your control, it must be WithEvents

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
Sorry ( Declare ) not instantiate

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
Nathan,

Why do you not make a very more user control and take in that the main
things from your more complex control and try it with that, makes telling in
this newsgroup as well more easier when you do not succeed.

Just my thought,

Cor
 
IIRC, when I was playing around with a user control, if I already had the
user control on a form it would not pick up the changes. I had to remove
the user control from the form and then add it to the form. Only then would
I see the new behavior. IIRC! And note that I am very new to this stuff,
so take that into consideration.

Good Luck, Bob
 
Back
Top