Creating and displaying a Quote Balloon RRS feed

  • Question

  • I have a GIS desktop application I'm developing under .Net 3.5 using Geoframeworks GIS.Net 3.0. I want to display a info balloon when the mouse hovers over a object moving on the map. I have the event trap fine but unable to use contextmenu becuase I have no Control to link to and ToolTips does not seem to appear when executed. This is a  threaded app so I'm using a delagate to call the method that builds the below tooltip code. I'm also trying to display the balloon in the proximity to the mouse click so I'm using the X & Y coordinates from the Control.MouseLocation property to locate the tooltip.

    Any help with what I'm doing wrong would be great.




            //Create an ellipse that will have a 
            //ToolTip control. 
            System.Windows.Shapes.Ellipse ellipse1 = new System.Windows.Shapes.Ellipse();
            ellipse1.Height = 25;
            ellipse1.Width = 50;
            ellipse1.Fill = System.Windows.Media.Brushes.Gray;
            ellipse1.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            //Create a tooltip and set its position.
            System.Windows.Controls.ToolTip tooltip = new System.Windows.Controls.ToolTip();
            tooltip.Placement = System.Windows.Controls.Primitives.PlacementMode.Right;
            tooltip.PlacementRectangle = new System.Windows.Rect(System.Windows.Forms.Control.MousePosition.X, System.Windows.Forms.Control.MousePosition.Y, 50, 30);
            tooltip.HorizontalOffset = 10;
            tooltip.VerticalOffset = 20;
            System.Windows.Controls.Primitives.BulletDecorator bdec = new System.Windows.Controls.Primitives.BulletDecorator();
            System.Windows.Shapes.Ellipse littleEllipse = new System.Windows.Shapes.Ellipse();
            littleEllipse.Height = 10;
            littleEllipse.Width = 20;
            littleEllipse.Fill = System.Windows.Media.Brushes.Blue;
            bdec.Bullet = littleEllipse;
            TextBlock tipText = new TextBlock();
            tipText.Text = "Your data goes here";
            bdec.Child = tipText;
            tooltip.Content = bdec;
            ellipse1.ToolTip = tooltip;

    • Moved by Mike Dos Zhang Monday, December 6, 2010 2:29 AM third party product (From:Visual C# General)
    Tuesday, November 30, 2010 7:54 PM

All replies