B
Brian Henry
Hello,
I am trying to make a user control that is interactive. What I am doing is
drawing a set of bars on a control similar to a gantt chart and allowing a
user to place the mouse over them to see a tool tip, or if you click on them
to open a form associated with data tied behind them.
What I can't figure out how to do (I have been looking at a few very complex
examples and it's hard to pull out how they did it) is how do you create a
control like this, draw any number of these objects on it then do this hit
test. the first one I pretty much have figured out, each bar item on the
chart will be a instanciation of a LineBar class which is stored in an
arraylist of other bars in the control then the OnPaint method calls each
item's render method I created to draw that item. (I believe thats how I
should do it?) anyways, the part I can not figure out is how to do an
effective hit test on the objects. How do you figure out which one had mouse
interaction, and what type of mouse interaction occured? I'm looking for a
simple example that is explained relatively good so I can fully understand
it. All the examples I have looked at had tons of unrelated code mixed into
them so discerning between the hit test code and the unrelated code is hard.
Thanks everyone!
I am trying to make a user control that is interactive. What I am doing is
drawing a set of bars on a control similar to a gantt chart and allowing a
user to place the mouse over them to see a tool tip, or if you click on them
to open a form associated with data tied behind them.
What I can't figure out how to do (I have been looking at a few very complex
examples and it's hard to pull out how they did it) is how do you create a
control like this, draw any number of these objects on it then do this hit
test. the first one I pretty much have figured out, each bar item on the
chart will be a instanciation of a LineBar class which is stored in an
arraylist of other bars in the control then the OnPaint method calls each
item's render method I created to draw that item. (I believe thats how I
should do it?) anyways, the part I can not figure out is how to do an
effective hit test on the objects. How do you figure out which one had mouse
interaction, and what type of mouse interaction occured? I'm looking for a
simple example that is explained relatively good so I can fully understand
it. All the examples I have looked at had tons of unrelated code mixed into
them so discerning between the hit test code and the unrelated code is hard.
Thanks everyone!