Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

(C#) Fixed Vertex point, but draggable user control.

 

I need help...

I would like to have a user control with a vertex like "those balloon tooltips".

I would like to call this control at any point on the screen and it pops up with a vertex at the mouse point.

Then i would like to drag this control...BUT: Keep the vertex point fixed, the size of the long arm should be the one to move.The panel size can also be fixed(assuming we are going to use a panel like UC).

 

So far:

I got some where and now i need [one] fix to get this resolved.

Attached herewith is a mockup of what i want.

I put it together using the code Click Here

and Click there.

 

Issue: I can create the Panel and the Triangular region, but i am failing to drag the panel together with the triangular region. The issue as i indicated in the code is in the event handler, the drag cant seem to be called. I tried to step through and all tricks but am failing. Any help will be appreciated.

 

regards.

PopupDraggable.zip

Edited by skea
  • Administrators
Posted

Re: (C#) Fixed Vertex point, but draggable user control.

 

I think the problem is down to the fact the panel is handling the dragging and as such the event is never getting raised. It might be easier to associate the triangle with the panel directly and manage it's position as part of the panel movement.

 

I might have a bit of free time later and will have a look if it turns out I do.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

Man,thanks for the effort mate. I see it coming.

i also notice that almost the samething happens when i want to remove a panel.

I can remove the one i have just inserted but not the previous.

 

Anyway, let me wait with what you will come up with.

Posted (edited)

Re: Fixed Vertex point, but draggable user control.(Balloon Identifier)

 

let me give this a name. From now on, it will be called a "Balloon Identifier"

I got it working. I just added a refresh method for the parent after moving/resizing the panel and it did the trick.

 

In the ResizablePanel on MouseDown Event, Below the switch statement. I added this.

      case MousePos.Move:
                   {
                       NativeCalls.ReleaseCapture(hwnd);
                       NativeCalls.SendMessage(hwnd, NativeCalls.WM_SYSCOMMAND, NativeCalls.SC_DRAGMOVE, ref nul);
                       
                   } break;
               default:
                   break;
           }
           this.Parent.Refresh();------->Added

 

But now....the Removal of the Panels when there is more than one "Balloon Identifier" on the form.

ToDO:Turn the Panel into an Ellipse of some sort.

 

Thanks mate.

Edited by skea
Posted (edited)

Today is a good day for me! I got the removal of the "Balloon Identifier" to work too.

Todo:

1)Making it in form of an ellipse(rectangle with curves at the corners) is remaining.

2)If some one clicks in the middle of the screen area, the triangle draws with its intersection in the "middle left" of the panel(Balloon).

And if the user clicks in an area almost next to the bottom of the screen, the intersection is "bottom left" of the balloon.

3)Triangle should be drawn with variable points at the center of the balloon implying a "longer length" for its arm.(this is to make it look ok if the use drags it from one direction to another.)

Edited by skea
Posted (edited)

Ha ha ha...how does this look?

The only issue is to "BringToFront" the triangle of the focused panel when it overlays on top of another panel.

Edited by skea
Posted

Thanks so much.

As you can see, i have added a close button, instead of using a context menu.

 

My issue now is bringing the triangle to the front when a corresponding panel is passed over another panel.

  • 3 weeks later...
Posted
Hi. It isn't the problem of the pen and the size of the triangle. If you place a small picture of a point on the form and you try it, you will notice what i am talking about. And when the form is zoomed in, the distance of tolerance is too big.
  • Administrators
Posted
Odd, when I was playing around with it on my PC I had it draw the pixel for the fixed point in black and it kept a constant position on the form despite the triangle's end point moving around. When I reduced the pen width the end of the triangle seemed to be closer to this point and the movement reduced.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted (edited)
Hi, you are right. i was debugging and starting another .exe. Sorry for that. It does the trick.i changed the pen to width 0, except that i seem to loose my borderline(which i wanted so much). Now i will try to make it zoomable.thanks. Edited by skea

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...