usercontrol acting weird (urgent)

i am creating my own flatbutton, but am walking into a strange problem:

my button is a usercontrol with a label for the text, and it draws lines for the border

now on my usercontrol_click i do a RaiseEvent Click
that works fine

on the label_click i tried to do UserControl_Click, and RaiseEvent Click
but none of them works

more weird is, that the whole label_click doesnt work!

does anyone know what could be the problem?

VB6 SP5
win xp home sp2
LVL 13
Mark_FreeSoftwareAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

clarkscottCommented:
Put a stop in the On_click event of the label and try running your program.  Maybe the On_click works.... your code doesn't.

Let me know....

Scott C
Mark_FreeSoftwareAuthor Commented:
>>Put a stop in the On_click event of the label and try running your program

i tried that and it didnt break

Mark_FreeSoftwareAuthor Commented:

maybey i need to tell this too:

i haven't compiled my usercontrol, it is in the same project as the form it's on so it will compile inside my project without the need for another file
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

clarkscottCommented:
That shouldn't matter.  Where the file is actually saved is not an issue.  
You said you have a box around the label  -  maybe this is what's intercepting the On_click and the label is not actually getting the focus.  Try removing all other controls except the label and try it.

If it works... let's figure it out from there.


Scott C.
Mark_FreeSoftwareAuthor Commented:

the box is drawn from 4 seperate lines, but they cannot intercept the click since lines don't have events

and the label is (apart from the lines) the only control on the usercontrol
clarkscottCommented:
>my button is a usercontrol with a label for the text, and it draws lines for the border<

Something is 'getting the click'.  If the usercontrol isn't, then the 'label for the text' is.  Is the label a seperate label control?  

If you're absolutely sure that the usercontrol is the only thing that could possibly be 'getting the click' then I maybe you should investigate your usercontrol.  Is this an ActiveX you created yourself? Could the code be incomplete?

???

Scott C.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
clarkscottCommented:
Further... try compiling the usercontrol.

Scott C.
Mark_FreeSoftwareAuthor Commented:
>>Is the label a seperate label control?

yes, on the usercontrol

>>If you're absolutely sure tha......

yes, i put breakpoint on the usercontrol and on the label, and none of them got the click, i even checked in notepad to see if there was some invisible item, but there wasnt.

it is not an activex, it is a usercontrol built by myself (clicked rmb on the project tree, and then add->usercontrol->flatbutton)
i created it a while ago and put it in my templates dir


any ideas?

else i'm going to put the text with the drawtextex api
Mark_FreeSoftwareAuthor Commented:
>>Further... try compiling the usercontrol.

i am trying to let my usercontrol uncompiled so i won't have another dependency
Mark_FreeSoftwareAuthor Commented:


when i last opened a custom userctl (from psc i think) i saw the comment that in a usercontrol the click events of labels and such are not processed, is this true?
clarkscottCommented:
I can't answer that question..... but if someone else stated that... then I bet it's true.  Maybe you need to revisit this usercontrol and design differently.

Scott C.
Mark_FreeSoftwareAuthor Commented:

yeah i think i'm going to use the mouseup event of the label, maybey it will work then....
clarkscottCommented:
Good luck - let us know if it works

Scott C.
Mark_FreeSoftwareAuthor Commented:

yeah that worked

i am thinking about giving you the points and a grade of a because you keeped trying, how about that?
clarkscottCommented:
Thanks and good luck!

Scott C.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.