borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (How to scroll down a VSFlexgrid?)Next Topic (ActiveX questions) New Topic New Poll Post Reply
AndreaVB Forum : ActiveX : Clickable Line Control
Poster Message
yasserjee
Level: Guest


icon Clickable Line Control

HI Guys !!!! i need a line control which supports click event.plz suggest me some link aor preferably give me the ocx

11-11-2003 at 05:06 AM
| Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: Clickable Line Control

draw a picturebox inside your activex control... then perhaps you may set the control's background to transparent...

and then, change the size of the picture box to how thin yo want... then on it's click event, raise the "click event" for the user control.

...i assume you know how to program activex controls already, okay? let us know if you need more.

____________________________
Been busy trying to take a second degree <--it's not working out...

12-11-2003 at 06:35 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Clickable Line Control

Line control is not hard to make, except maybe for DrawMode property, but Click Event will have to take some modifications.

vbgen's idea can work in cases when Line1.x1=Line1.x2 or Line1.y1=Line1.y2, bu the problem comes when user wants to draw a line which is not horizontal or vertical, but bias. So, when clicked anywhere inside rectangle it will raise an UserControl_Click Event (not just on line).

In this case you would have to check if it is clicked on line, or near it (lets say 1 pixel as tolerancy), which also shouldnt be hard.

But, what intrigues me is, how can be made line control which will have aperiance on the form in design mode same as microsoft; line control has??  

____________________________
If you find the answer helpful, please mark this topic as solved.

15-11-2003 at 02:49 AM
View Profile Send Email to User Show All Posts | Quote Reply
viklele
Level: Big Cheese

Registered: 16-10-2002
Posts: 25
icon Re: Clickable Line Control

MS line control is a windowless control. I think the clickable line control will have to be windowless as well. Though a windowless control means that it cannot come above its windowed siblings in Zorder.

Further, you will need to handle HitTest event of the UserControl to convey if the mouse is hitting the "line" area or elsewhere, so that the mouse events can get propogated to other controls that are covered by the smallest bounding rectangle of our line control.

- Vikram

[Edited by viklele on 20-11-2003 at 01:15 PM GMT]

____________________________
------------------------------------------
Components For Your Software Solutions
http://www.viklele.com

20-11-2003 at 08:10 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : ActiveX : Clickable Line Control
Previous Topic (How to scroll down a VSFlexgrid?)Next Topic (ActiveX questions) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder