User (Legacy) Posted November 5, 2002 Report Share Posted November 5, 2002 I have a control container that contains many child controls including a ChartFX.Chart. I've also added a ToolTip control to this container, so I can easily visit each tooltip property of each control and set a text tip which works fine for all my controls except if its a ChartFx control. I want the tip to pop up if any portion of the Chart is moused over. Am I missing something? I couldnt' find anything that popped up in the documentation (hard book). It seems to require another implementation than other controls. Thanks for any replies! -tim //Local Vars private System.Windows.Forms.ToolTip toolTipInstance; private SoftwareFX.ChartFX.Chart chartView; private oneOfManyOtherControls; //InitializeComponent() this.toolTipInstance= new System.Windows.Forms.ToolTip(this.components); this.toolTipInstance.SetToolTip(this.oneOfManyOtherControls, "Choose a tip"); //Works this.toolTipInstance.SetToolTip(this.chartView, "Choose another tip"); //Doesn't Work //Add to collection this.Controls.AddRange(new System.Windows.Forms.Control[] {this.chartView, this.oneOfManyOtherControls}); Link to comment Share on other sites More sharing options...
User (Legacy) Posted November 5, 2002 Author Report Share Posted November 5, 2002 I forgot to mention that I set the .ShowTips property to false for the Chart, but I still didn't get the tips shown with my tip object. Thanks for any help, tim "Tim Burnham" <timothy.burnham@compuware.com> wrote in message news:h00aMORhCHA.3600@webserver1.softwarefx.com... > I have a control container that contains many child controls including a > ChartFX.Chart. I've also added a ToolTip control to this container, so I > can easily visit each tooltip property of each control and set a text tip > which works fine for all my controls except if its a ChartFx control. I > want the tip to pop up if any portion of the Chart is moused over. Am I > missing something? I couldnt' find anything that popped up in the > documentation (hard book). It seems to require another implementation than > other controls. Thanks for any replies! > > -tim > > > > //Local Vars > private System.Windows.Forms.ToolTip toolTipInstance; > > private SoftwareFX.ChartFX.Chart chartView; > > private oneOfManyOtherControls; > > > > //InitializeComponent() > > this.toolTipInstance= new System.Windows.Forms.ToolTip(this.components); > > this.toolTipInstance.SetToolTip(this.oneOfManyOtherControls, "Choose a > tip"); //Works > > this.toolTipInstance.SetToolTip(this.chartView, "Choose another tip"); > //Doesn't Work > > > > //Add to collection > > this.Controls.AddRange(new System.Windows.Forms.Control[] {this.chartView, > this.oneOfManyOtherControls}); > > > > > Link to comment Share on other sites More sharing options...
Software FX Posted November 6, 2002 Report Share Posted November 6, 2002 Because the chart control is really a control container (it has other controls inside). This approach doesn't work as it associates the tooltip to the wrong control, the parent of all which is not the one that gets the mouse events. The following code allow you to assign your own tooltip to the chart: chart1.ShowTips = false; toolTip1 = new ToolTip(); toolTip1.SetToolTip(chart1.Controls[0],"Chart Tool Tip"); Notice that the tooltip is not attached to the chart itself but to a child control of it. -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.