Custom controls

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
 
O

One Handed Man \( OHM - Terry Burns \)

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))
 
O

One Handed Man \( OHM - Terry Burns \)

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))
 
C

Cor Ligthert

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
 
E

eBob.com

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
 
N

Nathan

The control is automatically declared Friend Withevents when I drag it onto
the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top