|
-
Nov 26th, 2001, 01:01 PM
#1
Thread Starter
Hyperactive Member
Class Object Events
Hi
I made a class that selects an area with a rubberband. This gives me the left and top and the right and bottom to work with. My problem is once I get this info I want this area to live on it's own with events such as myArea_click(x as single,y as single). How do I create and get this type of event to completely ignore the button down event of the form without using a conditional in the button down event.
In other words - How do I make this area a completely independent object such as a picturebox?
-
Nov 26th, 2001, 04:42 PM
#2
Thread Starter
Hyperactive Member
Is this fact?
Thanks but I can't accept that. There is always a way. Even if I gotta jump through hoops and stand on my ear I wanna know how I can make this happen. Anyone?
-
Nov 26th, 2001, 06:43 PM
#3
You COULD create a child window of the form or picture box, using pure API, and write a message handling function, but then you simply delegate the need to loop (to find the correct event to run) to a Window Message Procedure. You would also have to add functionality to Blt the area being covered by the new window to the window to make it seamless.
You could also create a custom control, instead of a class. This would be about the same amount of work as the method I first put forward, and much easier then the second, but you seemed to want a class...
Z.
-
Nov 26th, 2001, 07:57 PM
#4
Good Ol' Platypus
For the click event, you could (possibly) find the form's RECT, get the top and left of your "area", and make a rectangle out of it's width, offsetting it from the left and top of the form. Then, you can check to see if the mouse is in your area when you check it.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Nov 26th, 2001, 08:21 PM
#5
That was my first Idea =). He didnt like it though.
Z.
-
Nov 27th, 2001, 12:15 PM
#6
Thread Starter
Hyperactive Member
Thanks for all the help. Looks like it's going to be a usercontrol then. I only thought class so I could have code in one place. Control will give me events I need too outside of main code.
Question: Will I get the same performance using a user control as I would if the code were all in one big spegetti app?
-
Nov 27th, 2001, 03:48 PM
#7
Good Ol' Platypus
I think it would be slower if you had it in an OCX (i think).
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Nov 27th, 2001, 03:53 PM
#8
OCX = Class.
At least in practice. Both end up as COM objects, the only real difference is that an OCX is a separate component.
Z.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|